<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font face="Georgia">This method in HandMorph seems to have a
        view of corner rounding that depends on a particular corner
        geometry. You might try changing the highlighted code to <br>
      </font></p>
    <p><font face="Georgia"><br>
      </font></p>
    <pre><font face="Georgia">            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 <---"
</font></pre>
    <p><font face="Georgia">Some drawing of morphs in the hand may be
        slower, but on modern machines you might never notice it.<br>
      </font></p>
    <pre><font face="Georgia">updateCacheCanvas: aCanvas 
    "Update the cached image of the morphs being held by this hand."

    "Note: The following is an attempt to quickly get out if there's no change"

    | subBnds rectList nPix |
    subBnds := Rectangle merging: (submorphs collect: [:m | m fullBounds]).
    rectList := damageRecorder invalidRectsFullBounds: subBnds.
    damageRecorder reset.
    (rectList isEmpty 
        and: [cacheCanvas notNil and: [cacheCanvas extent = subBnds extent]]) 
            ifTrue: [^self].

    "Always check for real translucency -- can't be cached in a form"
    self submorphsDo: 
            [:m | 
            m wantsToBeCachedByHand 
                ifFalse: 
                    [cacheCanvas := nil.
                    cachedCanvasHasHoles := true.
                    ^self]].
    (cacheCanvas isNil or: [cacheCanvas extent ~= subBnds extent]) 
        ifTrue: 
            [cacheCanvas := (aCanvas allocateForm: subBnds extent) getCanvas.
            cacheCanvas translateBy: subBnds origin negated
                during: [:tempCanvas | self drawSubmorphsOn: tempCanvas].
            self submorphsDo: 
                    [:m | 
                    (m areasRemainingToFill: subBnds) isEmpty 
                        ifTrue: [^cachedCanvasHasHoles := false]].
 <b><font color="#ff0000">           nPix := cacheCanvas form tallyPixelValues first.
            "--> begin rounded corners hack <---"
            cachedCanvasHasHoles := (nPix = 48 
                        and: [submorphs size = 1 and: [submorphs first wantsRoundedCorners]]) 
                            ifTrue: [false]
                            ifFalse: [nPix > 0].
            "--> end rounded corners hack <---"
</font></b>            ^self].

    "incrementally update the cache canvas"
    cacheCanvas translateBy: subBnds origin negated
        during: 
            [:cc | 
            rectList do: 
                    [:r | 
                    cc clipBy: r
                        during: 
                            [:c | 
                            c fillColor: Color transparent.
                            self drawSubmorphsOn: c]]]</font>
</pre>
    <br>
    <div class="moz-cite-prefix">On 12/5/16 8:47 PM, tim Rowledge wrote:<br>
    </div>
    <blockquote
      cite="mid:B3DDBD58-FC92-481B-9DD2-84ADB7C44B17@rowledge.org"
      type="cite">
      <pre wrap="">In a plain Squeak 5.1 image, create a RectangleMorph and use its menu to set ‘round corners’.
Open the PreferenceBrowser and find the ‘Preferred Corner Radius’ - in the copy of the release 5.1-16548 I have that is ‘8’.

Now drag the rectangle morph - note how the corners get replaced by funny little filled triangles instead of being rounded!
Now change the preferred radius to 7. Note how the dragging works perfectly well. Try 9. Hell, try any other number.

So far as I can tell only 8 causes a problem. Clearly one answer is “don’t do that” and change the default. But I’m completely baffled as to what is going on here. Why only 8? Why only when being dragged? Right now I’m not able to spot where the drag rendering might diverge.

tim
--
tim Rowledge; <a class="moz-txt-link-abbreviated" href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a class="moz-txt-link-freetext" href="http://www.rowledge.org/tim">http://www.rowledge.org/tim</a>
"Bother" said Pooh as "Formating Drive C" appeared on the screen...



</pre>
    </blockquote>
    <br>
  </body>
</html>