[ENH]TransformMorph caching ( do we need to account for invisible morphs? )

ned at bike-nomad.com ned at bike-nomad.com
Sat Jul 26 17:35:07 UTC 2003


This looks OK, but I noticed that the code for computing the bounds is
more or less the same as in TransformMorph>>localVisibleSubmorphBounds
(or for that matter Morph>>submorphBounds). Which raises this question
(which is really more a question about the code changes I did back in CS
4836, back in 4/2002):

The new version could almost be rewritten as:

localBounds
	^localBounds ifNil: [ localBounds _ self localVisibleSubmorphBounds ].

EXCEPT...

the one difference is that #localVisibleSubmorphBounds accounts for
invisible submorphs, and this code doesn't. So if the first or last few
morphs aren't visible, you'll get a different extent for submorphBounds
and localSubmorphBounds. Since #localSubmorphBounds is used to compute
the scroll range, it seems to make sense that you'd want to account for
invisible morphs.

So my suggestion is to use the above code instead. Unless someone can
think of why we'd want to ignore the invisible morphs sometimes and not
other times. I can't remember why I did this, now.

And if we do that, we should change the callers of
#localVisibleSubmorphBounds to use #localSubmorphBounds instead to take
advantage of the caching.
















< I'm a bug-fixing machine! >

This post brought to you by the BugFixArchiveViewer, a handy tool that
makes it easy to comment on proposed fixes and enhancements for Squeak. 
For more information, check out the Web page for the BugFixArchiveViewer
project: http://minnow.cc.gatech.edu/squeak/3214 

< I'm a bug-fixing machine! >



More information about the Squeak-dev mailing list