[squeak-dev] Morph corner radius set to 8 does surprising things

Bob Arning arning315 at comcast.net
Tue Dec 6 14:37:23 UTC 2016

It's not too unusual -- just old. There was, 15 years ago, some related 
code in HandMorph>>fullDrawOn: and your rounded-corner morph was 
correctly drawn, regardless of whether cachedCanvasHasHoles was set to 
true or false. Since that time, the drawing of rounded corners (and drop 
shadows as well, I guess) has changed a bit and now the value of 
cachedCanvasHasHoles does matter -- it needs to be true for 
rounded-corner things to draw correctly.

On 12/6/16 12:26 AM, tim Rowledge wrote:
>> On 05-12-2016, at 6:57 PM, Bob Arning <arning315 at comcast.net> wrote:
>> This method in HandMorph seems to have a view of corner rounding that depends on a particular corner geometry.
> Thanks; that seems to be the responsible method. I’m quite at a loss to explain what was being thought of for the hack. Most … unusual.
>> You might try changing the highlighted code to
>>              nPix := cacheCanvas form tallyPixelValues first.
>>              "--> begin rounded corners hack <---"
>>              cachedCanvasHasHoles := true "(nPix = 48
>>                          and: [submorphs size = 1 and: [submorphs first wantsRoundedCorners]])
>>                              ifTrue: [false]
>>                              ifFalse: [nPix > 0]".
>>              "--> end rounded corners hack <—"
> Instead of simply forcing cachedCanvasHasHoles to be true, it seems to work cleanly with
>       cachedCanvasHasHoles := nPix >0.
> which at least makes use of the tallyPixelValues first - which is quite a bit of work.
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Useful random insult:- Wasn't fully debugged before being released.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20161206/358a4d1f/attachment.html>

More information about the Squeak-dev mailing list