[BUG] Avoid text occlusion

schwa at cc.gatech.edu schwa at cc.gatech.edu
Fri Sep 1 05:09:21 UTC 2000


Here is how to cause an error which sometimes crashes the system, and
other times just causes the owner of the text to stop drawing and pop up
a walkback.  The test system is a fully updated, but otherwise vanilla,

Embed some text in another morph (I tested with embedding in an
EllipseMorph, RectangleMorph and PasteUpMorph).  Tell it to 'fill its
owner's shape' and 'avoid occlusions'.  Then, embed another morph
(tested with EllipseMorph and RectangleMorph) in the text's owner. 
Bring up a halo on the new morph and drag it around against its owner's
top border.

The error manifests itself first (that I can see) in 
NewParagraph>>composeLinesFrom: start to: stop delta: delta into:
lineColl priorLines: priorLines atY: startingY

in the following code fragment (at the '--->'):

			lineY > bottom
				ifTrue: ["Oops -- the line is really too high to fit -- back out"
						charIndex _ saveCharIndex.
						row do: [:r | lines removeLast]]
				ifFalse: ["It's OK -- the line still fits."
						maxRightX _ maxRightX max: scanner rightX.
--->						1 to: row size - 1 do:  "Adjust heights across row if necess"
							[:i | (lines at: lines size - row size + i)
									lineHeight: lines last lineHeight
									baseline: lines last baseline].

For some reason that would not become evident to me, 'row size' is
greater than 'lines size', resulting in an attempt to access a
collection at index 0.

Hopefully someone has better eyes than me and can figure this one out.

More information about the Squeak-dev mailing list