[squeak-dev] The Trunk: Morphic-fbs.677.mcz

Frank Shearar frank.shearar at gmail.com
Sun Aug 11 14:27:48 UTC 2013


On 10 August 2013 23:46, Levente Uzonyi <leves at elte.hu> wrote:
> On Sat, 10 Aug 2013, commits at source.squeak.org wrote:
>
>> Frank Shearar uploaded a new version of Morphic to project The Trunk:
>> http://source.squeak.org/trunk/Morphic-fbs.677.mcz
>>
>> Item was added:
>> + ----- Method: CurvierMorph class>>Curvier (in category 'class
>> initialization') -----
>> + Curvier
>> +       <preference: 'Curvier'
>> +               category: 'morphic'
>> +               description: 'If true, closed CurvierMorphs will be
>> smoother and more symmetrical all about. If false they will mimic the old
>> curve shapes with the one sharp bend.'
>> +               type: #Boolean>
>> +       ^ self drawCurvier.!
>>
>> Item was added:
>> + ----- Method: CurvierMorph class>>drawCurvier (in category 'class
>> initialization') -----
>> + drawCurvier
>> +       ^ DrawCurvier.!
>
>
> I think the above two methods should be replaced with this:
>
> drawCurvier
>
>         <preference: 'Curvier'
>                 category: 'morphic'
>
>                 description: 'If true, closed CurvierMorphs will be smoother
> and more symmetrical all about. If false they will mimic the old curve
> shapes with the one sharp bend.'
>                 type: #Boolean>
>         ^DrawCurvier ifNil: [ true ]
>
> Why?
> - The setter method's name is derived from the getter method's name via
> #asMutator. The getter method is always the method which holds the pragma.
> So this code doesn't work.
> - It's better to have a default value, than to get a debugger when the
> variable is uninitialized.
> - Capitalized selector names are unusual in smalltalk code, when no external
> code/data/objects are involved.

I'd largely agree, but I intentionally performed a _refactoring_ here,
preserving the API. We should do what you suggest, and keep Curvier
but deprecated and in 45Deprecated for eventual GC.

frank

> Levente
>
>
>>
>> Item was added:
>> + ----- Method: CurvierMorph class>>drawCurvier: (in category 'class
>> initialization') -----
>> + drawCurvier: aBoolean
>> +       DrawCurvier := aBoolean.!
>>
>> Item was changed:
>>  ----- Method: PolygonMorph>>isCurvier (in category 'testing') -----
>>  isCurvier
>>         "Test used by smoothing routines.  If true use true closed curve
>> splines for closed curves. If not mimic old stodgy curveMorph curves with
>> one sharp bend.. Override this routine in classes where backward
>> compatability is still needed."
>> +       ^ CurvierMorph drawCurvier!
>> -       ^ (Preferences valueOfFlag: #Curvier)!
>>
>>
>>
>


More information about the Squeak-dev mailing list