Skip to content

Commit

Permalink
Merge pull request #61 from Rinzwind/rsathensmorph-scaling-check-syst…
Browse files Browse the repository at this point in the history
…emversion

Restrict changes done to #drawOn: on RSAthensMorph in pull request #56 to Pharo 12
  • Loading branch information
jecisc authored Mar 15, 2024
2 parents 07c8952 + 7d52bc1 commit f926555
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Roassal/RSAthensMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ RSAthensMorph >> drawOn: aCanvas [
isDrawing := true.
[
self checkSession.
self recreateSurfaceIfNecessary: aCanvas scale.
self recreateSurfaceIfNecessary:
(SystemVersion current major >= 12 ifTrue: [ aCanvas scale ] ifFalse: [ 1 ]).
aCanvas
fillRectangle: self bounds
fillStyle: roassalCanvas color
Expand All @@ -83,11 +84,20 @@ RSAthensMorph >> drawOn: aCanvas [

surface hasBeenFreed
ifTrue: [ self createSurface ].
[ aCanvas
formSet: (FormSet extent: self extent asIntegerPoint depth: 32 forms: { surface asForm })
at: self bounds origin asIntegerPoint
sourceRect: (0 @ 0 extent: surface extent)
rule: Form blendAlphaScaled ]
[ SystemVersion current major >= 12
ifTrue: [
aCanvas
formSet: ((Smalltalk at: #FormSet) extent: self extent asIntegerPoint
depth: 32 forms: { surface asForm })
at: self bounds origin asIntegerPoint
sourceRect: (0 @ 0 extent: surface extent)
rule: Form blendAlphaScaled ]
ifFalse: [
aCanvas
image: surface asForm
at: self bounds origin asIntegerPoint
sourceRect: (0 @ 0 extent: surface extent)
rule: 34 ] ]
on: Exception
do: [ :ex | ex traceCr ]
] ensure: [ isDrawing := false ]
Expand Down

0 comments on commit f926555

Please sign in to comment.