Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1744.mcz ==================== Summary ==================== Name: Morphic-mt.1744 Author: mt Time: 13 April 2021, 2:36:03.188381 pm UUID: 4f11bc72-a3e8-f641-bccd-13f087ce6464 Ancestors: Morphic-nice.1743, Morphic-ct.1528 Merges Morphic-ct.1528 with extended commentary. =============== Diff against Morphic-nice.1743 =============== Item was added: + ----- Method: Morph>>pointAtFraction: (in category 'geometry') ----- + pointAtFraction: relativePoint + "For values between 0.0 and 1.0, answers a point that lies within the receiver's bounds. This method is a more general form of #center (meaning 0.5@0.5), #topLeft (meaning 0.0@0.0), #bottomCenter (meaning 0.5@1.0), etc. If can be useful for layout policies that want to position or resize their submorphs by fraction." + + ^ self bounds pointAtFraction: relativePoint! |
Thanks for merging! :-)
> + "For values between 0.0 and 1.0, answers a point that lies within the receiver's bounds. This method is a more general form of #center (meaning 0.5@0.5), #topLeft (meaning 0.0@0.0), #bottomCenter (meaning 0.5@1.0), etc. If can be useful for layout policies that want to position or resize their submorphs by fraction." Note that "aRectangle pointAtFraction: 0.5" would work as well, thanks to the polymorphy in Point >> #*.
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 13. April 2021 14:36:15 An: [hidden email]; [hidden email] Betreff: [squeak-dev] The Trunk: Morphic-mt.1744.mcz Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1744.mcz ==================== Summary ==================== Name: Morphic-mt.1744 Author: mt Time: 13 April 2021, 2:36:03.188381 pm UUID: 4f11bc72-a3e8-f641-bccd-13f087ce6464 Ancestors: Morphic-nice.1743, Morphic-ct.1528 Merges Morphic-ct.1528 with extended commentary. =============== Diff against Morphic-nice.1743 =============== Item was added: + ----- Method: Morph>>pointAtFraction: (in category 'geometry') ----- + pointAtFraction: relativePoint + "For values between 0.0 and 1.0, answers a point that lies within the receiver's bounds. This method is a more general form of #center (meaning 0.5@0.5), #topLeft (meaning 0.0@0.0), #bottomCenter (meaning 0.5@1.0), etc. If can be useful for layout policies that want to position or resize their submorphs by fraction." + + ^ self bounds pointAtFraction: relativePoint!
Carpe Squeak!
|
Hi Christoph. > Note that "aRectangle pointAtFraction: 0.5" would work as well, thanks to the polymorphy in Point >> #*. You might want to add those special cases to the tests. I added some tests about #pointAtFraction: to RectangleTest. Best, Marcel
|
Free forum by Nabble | Edit this page |