The Puzzle Page

Bob Arning arning at charm.net
Fri Dec 15 00:55:32 UTC 2000


On Thu, 14 Dec 2000 13:31:53 -0800 "Raab, Andreas" <Andreas.Raab at disney.com> wrote:
>> 5.  Open a MonthMorph, and notice its behavior when you 
>> change its extent using the morph menu resize command.  
>> Notice that it repaints the entire region of the screen from 
>> screen topLeft to the bottomRight of the MonthMorph.
>
>Short answer: Global coordinates. E.g., what happens in many places is
>	someMorph addMorph: someOtherMorph new.
>	someOtherMorph position: someMorph position.
>[note that the positioning part may be implicit due to layouting]. So when
>the morph is first added it starts at 0 at 0 and when it is moved it moves to
>some other position. But naturally, the invalidation starts at 0 at 0.

Andreas,

I have been thinking that there may be a (partial, perhaps) solution to this. It seems to me that #invalidRect: only has a real meaning after a #drawOn:. Invalidation of bounds that have never been drawn does not seem to matter, so perhaps

SomeMorph>>drawOn:

	self setTheDrawnFlag.
	self continueDrawing

and

SomeMorph>>invalidRect:

	self drawnFlagIsSet ifTrue: [
		self reallyInvalidateTheRectangle.
		self resetTheDrawnFlag.
	].

would avoid this spurious activity.

Cheers,
Bob





More information about the Squeak-dev mailing list