[squeak-dev] The Trunk: Graphics-mt.520.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Thu Sep 15 17:59:14 UTC 2022


Hi Marcel,


> +        NOTE THAT for proportions that equal 1.0, the resulting point will NOT lie

> +        within the receiver, i.e., #containsPoint: will answer false."

could you explain shortly why #containsPoint: needs to answer false for the receiver's #bottomRight? This was shocking to me. :D

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: Mittwoch, 8. Juni 2022 14:50:07
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Graphics-mt.520.mcz

Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.520.mcz

==================== Summary ====================

Name: Graphics-mt.520
Author: mt
Time: 8 June 2022, 2:50:00.935335 pm
UUID: 8fb5feb3-71e4-1240-8c76-b10b119a18e2
Ancestors: Graphics-mt.519

Fixes a rounding issue with fractional points in integer rectangles.

=============== Diff against Graphics-mt.519 ===============

Item was changed:
  ----- Method: Rectangle>>pointAtFraction: (in category 'rectangle functions') -----
  pointAtFraction: relativePoint
+        "For values between 0.0 and 1.0, answers a point that lies within the receiver.
+        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.
+        NOTE THAT for proportions that equal 1.0, the resulting point will NOT lie
+        within the receiver, i.e., #containsPoint: will answer false."
+
-
         | result |
         result := self origin + (self extent * relativePoint).
         ^ self isIntegerRectangle
+                ifTrue: [result floor]
-                ifTrue: [result rounded]
                 ifFalse: [result]!


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


More information about the Squeak-dev mailing list