Apply application of world renderer canvas scale factor in #physicalSize on BlMorphicHostSpace to Pharo 12#537
Conversation
…ze on BlMorphicHostSpace apply the world renderer canvas scale factor”) to Pharo 12.
|
The checkout for the tests used commit 5fa5f0c which is a merge with the ‘dev’ branch, presumably because I had forgotten to change the base branch to ‘Pharo12’ when opening this pull request. |
|
I closed and reopened, the checkout for the tests now used commit f6a7a23 which is a merge with the ‘Pharo12’ branch as expected. |
| aClippedCanvas drawImage: spaceForm at: self position ] ] | ||
| SystemVersion current major >= 12 ifTrue: [ | ||
| | formSet | | ||
| formSet := (Smalltalk at: #FormSet) extent: self extent depth: spaceForm depth forms: { spaceForm }. |
There was a problem hiding this comment.
Was FormSet introduced in Pharo 12?
In any case, I have doubts about Smalltalk at: #FormSet. I think Pharo moves towards moving to use self class environment classNamed: #FormSet instead of it. @tesonep should now
There was a problem hiding this comment.
I introduced FormSet in Pharo 12 in Pharo pull request #14998.
It seemed better to keep the implementation the same as in the ‘dev’ branch. I don’t know whether the ‘dev’ branch is supposed to still be usable with Pharo 11 or even older versions though. If not, I could drop the SystemVersion checks and the use of Smalltalk in the ‘dev’ branch first and update this pull request accordingly.
There was a problem hiding this comment.
I have opened pull request #544 to remove support for Pharo 11.
There was a problem hiding this comment.
There was a problem hiding this comment.
OK thanks, I will close pull request #544 then.
| | canvasScaleFactor | | ||
|
|
||
| canvasScaleFactor := SystemVersion current major >= 12 | ||
| ifTrue: [ (Smalltalk at: #OSWorldRenderer) canvasScaleFactor ] |
There was a problem hiding this comment.
I think OSWorldRenderer existed in Pharo for several years, in which case the "Smalltalk at:" would not be needed... or is it a new class name?
There was a problem hiding this comment.
Getting the class through Smalltalk like this avoids an ‘unknown variable’ error in versions of Pharo that don’t have the class, which is probably not really relevant here as OSWorldRenderer exists since Pharo 8, but it also avoids a match of ReSendsUnknownMessageToGlobalRule in Pharo 11.
|
(A bit OFFTOPIC:) @Rinzwind do you have an opinion on As an exercise I rewrote a method in this PR as: ... at the end, BlPhysicalDisplaySize is the same as Point. |
|
I’m not entirely sure I understand the question about BlPhysicalDisplaySize, I tried just removing the send of |
|
Some context. At some moment of the history of Bloc (that I ignore) this hierarchy was introduced: But I find not much sense on these classes, and I wonder if we remove them. Or we improve so they start to make sense. I asked your opinion because maybe you had some comments either in favor or against these classes. |
|
This test shows its usage ( e.g.: Maybe if the physical device is modeled as a new class |
|
I’m not sure I can really help answer this question, but I can see benefit to having different classes for representing a position versus a size, and representing a scaled position or size versus one that is not scaled. When all four are represented as a plain Point, it can get confusing to keep track of which is which, especially when one can’t easily tell from the name of the variable the Point is contained in. Looking at the number of references to the classes and the senders of |

This pull request applies the changes of pull request #465 to the ‘Pharo12’ branch. The two SystemVersion checks could presumably be dropped, but I kept them to not deviate from the implementation in the ‘dev’ branch.