[Cuis-dev] Morph render leftovers when dragging the mouse
Nicolás Papagna Maldonado
nicolas.papagna at gmail.com
Mon Jul 26 16:53:29 PDT 2021
Hi Juan!
Thanks for taking the time to look into this.
I've cloned the Cuis repo and was able to reproduce the artifacts that are
shown in the video link I shared in the previous email.
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: (WidgetMorph new addMorph: label).
Tried running updated too, but that didn't work.
Am I missing something?
Best,
Nico PM
On Mon, Jul 26, 2021 at 4:03 PM Juan Vuletich <juan at jvuletich.org> wrote:
> 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 Vuletichwww.cuis-smalltalk.orghttps://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Devhttps://github.com/jvuletichhttps://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> 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
>
>
--
Nicolás Papagna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210726/3d14dfde/attachment.htm>
More information about the Cuis-dev
mailing list