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.
Cheers,
-- Scott
[FIX] creation of a LineMorph ([sm][cd] easy to understand fix) Hannes Hirzel hannes.hirzel.squeaklist at bluewin.ch Sat Mar 8 19:04:26 CET 2003
... The only change actually done in the change set was replacing 'PolygonMorph' with 'self' in a class method.
No problem. A good fix.
-- Hannes
chris at funkyobjects.org wrote:
--==CelesteAttachment73100==
from preamble:
"Change Set: creation of a LineMorph Date: 23 February 2003 Author: Chris Muller
replaces a hard-coded reference to PolygonMorph with logical class reference (self), allowing subclasses of LineMorph to properly instantiate."!
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.
Let's remove LineMorph and let's replace it by another entry in "Objects" chooser.
Cheers,
Diego Gomez Deck
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
On Sunday 09 March 2003 03:11 am, diegogomezdeck@consultar.com wrote:
Let's remove LineMorph and let's replace it by another entry in "Objects" chooser.
There are some users of LineMorph as I recall that will have to be rewritten.
I'd add another PolygonMorph constructor just for lines to replace the references to LineMorph (if it isn't already there; I don't have an image open right now).
Scott wrote:
|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.
thus: closed.
< 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! >
squeak-dev@lists.squeakfoundation.org