[FIX] creation of a LineMorph ([sm] [cd] doubts about this)
Ned Konz
ned at bike-nomad.com
Sat Mar 8 23:28:25 UTC 2003
On Saturday 08 March 2003 02:25 pm, Scott Wallace wrote:
> Before jumping into adopting this "fix", please look at the class
> comment of LineMorph.
>
> If I understand Dan's intentions correctly, LineMorph (which adds
> no instance variables and has no instance-side methods) is never
> intended to be instantiated; all instantiation calls to LineMorph
> are *expected* to result in instances of vanilla PolygonMorph.
>
> Thus, Dan's use of the hard-coded "PolygonMorph" in LineMorph
> class-side method #from:to:color:width: was decidedly intentional,
> and the proposed "easy to understand fix" violates that intention.
I agree. LineMorph is just a short-cut to construct 2-vertex
PolygonMorphs. I think the reason for LineMorph dates back to when
the NewMorph catalog was class-based and you couldn't have more than
one variant. So when you got a PolygonMorph, it was a closed curve,
and when you got a LineMorph, you had a PolygonMorph but it was an
open 2-vertex PM.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|