[BUG][FIX] RoundedMorphBounds
Alexander Lazarević
Alexander at Lazarevic.de
Thu Mar 25 22:27:35 UTC 2004
Wow, I don't know why most of the text is missing from the previous mail, but
anyway here is it again:
After I loaded all recent updates for 3.7alpha and my
HilightCurrentFontChoices changeset, I got an infinite loop when setting the
flap font. At first I thought I broke something with the 'enhancement', but
it happened also without it. Strangely enough everything worked in another
image without the recent updates. So I looked into the updates to see if
something strange has happened meanwhile. I couldn't find a thing. Then I
tried to find the reason for the infinite loop. I think Morph>extent: is
causing the loop in some cases where a FlapTab Morph boundary contains
floats. In these cases the expression 'bounds extent = aPoint' will evaluate
to false because of rounding errors. The layoutChanged method of FlapTab
sends an extent: message again and because of the failing condition it runs
in an infinite loop.
The attached changeset prevents this by rounding boundary values, although I
don't know if it is the best way to do it. Maybe it would be better to make a
special extent: method in FlapTab or to deal with this in a completely
different way...
I think this phenomenon is the same that Jim Benson reported almost a
year ago ([BUG] setFlapsFontTo: 32 bit display (9 April 2003), but he
suspected a different cause.
Alex
extent: aPoint
bounds extent = aPoint ifTrue: [^ self].
self changed.
bounds _ bounds topLeft extent: aPoint.
self layoutChanged.
self changed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: signature
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040325/cde8f170/attachment.pgp
More information about the Squeak-dev
mailing list
|