Skip to content

Commit

Permalink
Restricted changes done in commit 3db44c8 (“Made #physicalSize on BlM…
Browse files Browse the repository at this point in the history
…orphicHostSpace apply the world renderer canvas scale factor”) to Pharo 12 to maintain compatibility with earlier versions.
  • Loading branch information
Rinzwind committed Mar 7, 2024
1 parent 3db44c8 commit 0dd07ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/BlocHost-Morphic/BlMorphicHostSpace.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ BlMorphicHostSpace >> physicalSize [
This size may differ from the logical size on high dpi (retina) screens.
In most cases physical size is x2 larger than logical size on retina screens."

^ ((spaceHostMorph width @ spaceHostMorph height) * OSWorldRenderer canvasScaleFactor) asPhysicalSize
| canvasScaleFactor |

canvasScaleFactor := SystemVersion current major >= 12
ifTrue: [ (Smalltalk at: #OSWorldRenderer) canvasScaleFactor ]
ifFalse: [ 1 ].
^ ((spaceHostMorph width @ spaceHostMorph height) * canvasScaleFactor) asPhysicalSize
]

{ #category : #'window - properties' }
Expand Down
7 changes: 6 additions & 1 deletion src/BlocHost-Morphic/BlMorphicSpaceHostMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ BlMorphicSpaceHostMorph >> drawOn: aCanvas [
ifTrue: [ ^ self ].
hostSpace ifNotNil: [
aCanvas clipBy: self fullBounds during: [ :aClippedCanvas |
aClippedCanvas drawFormSet: (FormSet extent: self extent depth: spaceForm depth forms: { spaceForm }) at: self position ] ]
SystemVersion current major >= 12 ifTrue: [
| formSet |
formSet := (Smalltalk at: #FormSet) extent: self extent depth: spaceForm depth forms: { spaceForm }.
aClippedCanvas drawFormSet: formSet at: self position
] ifFalse: [
aClippedCanvas drawImage: spaceForm at: self position ] ] ]
]

{ #category : #geometry }
Expand Down

0 comments on commit 0dd07ef

Please sign in to comment.