[Cuis-dev] Morph render leftovers when dragging the mouse

Juan Vuletich juan at jvuletich.org
Mon Jul 26 12:00:00 PDT 2021


Hi Nico,

Your code works perfectly well on my pc on an updated Cuis. Maybe the 
bug you see has already been fixed?

Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



On 7/25/2021 3:39 PM, Nicolás Papagna Maldonado via Cuis-dev wrote:
> Friendly bump to see if anyone has a lead on this one :)
>
> Thanks in advance,
> Nico PM
>
> On Tue, Jul 20, 2021 at 4:17 PM Nicolás Papagna Maldonado 
> <nicolas.papagna at gmail.com <mailto:nicolas.papagna at gmail.com>> wrote:
>
>     Aloha folks!
>
>     I've run into the following issue. I'll do my best to explain it
>     with the following example.
>
>     TL;DR see video reproducing the issue here:
>     https://drive.google.com/file/d/1HikB46LCob-bf-W4LOnT_azH-0ohlB9I/view?usp=sharing
>
>     Let's say I want to display the class name of a morph when I point
>     to it.
>     If I do this, everything works fine:
>
>     label := UpdatingLabelMorph new
>         target: [
>             self runningWorld submorphs
>                 detect: [ :morph | morph containsGlobalPoint: self
>      runningWorld activeHand morphPositionInWorld ]
>                 ifFound: [ :morph | morph class name ]
>                 ifNone: [ 'nothing here' ]
>         ];
>         getSelector: #value;
>         stepTime: 10.
>
>     self
>         runningWorld
>         activeHand
>         attachMorphBeside: label.
>
>     If I try to attach a morph that contains the label defined above
>     (say I want to display something fancier, not just a label), then
>     every time I drag the mouse the label behaves like a "pen"
>     leaving traces of its old renders on the canvas:
>
>     self
>         runningWorld
>         activeHand
>         attachMorphBeside:  (WidgetMorph new addMorph: label).
>
>     My gut feeling is that this might be related to the fact that the
>     WidgetMorph that contains the label is not aware that it is
>     rendered outside of its bounds, but I don't have much experience
>     with Morphic.
>
>     1) Am I doing something wrong/missing an important concept for
>     understanding how Morphic works?
>     2) Related to that: I often find myself wrapping a bunch of morphs
>     to add behavior/glue code to them, but that wrapper does not do
>     any rendering. What would be the right way to adjust the wrapper's
>     extent to fit its submorphs perfectly (e.g. no extra space/no
>     clipping)?
>
>     Thanks in advance,
>     Nico PM
>
>
>
> -- 
>
> Nicolás Papagna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210726/d527c66f/attachment.htm>


More information about the Cuis-dev mailing list