[squeak-dev] The Trunk: Morphic-mt.1744.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Apr 14 08:04:53 UTC 2021


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
Am 13.04.2021 19:50:03 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
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 at 0.5), #topLeft (meaning 0.0 at 0.0), #bottomCenter (meaning 0.5 at 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 <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Dienstag, 13. April 2021 14:36:15
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
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 [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 at 0.5), #topLeft (meaning 0.0 at 0.0), #bottomCenter (meaning 0.5 at 1.0), etc. If can be useful for layout policies that want to position or resize their submorphs by fraction."
+
+        ^ self bounds pointAtFraction: relativePoint!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210414/e2d3a6cf/attachment.html>


More information about the Squeak-dev mailing list