[Cuis-dev] Clipping morph

Juan Vuletich juan at jvuletich.org
Mon Jun 7 14:58:31 PDT 2021


On 6/7/2021 2:53 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan
>
> Le 07/06/2021 à 16:37, Juan Vuletich a écrit :
>>>
>>> When I set my drawable canvas clipsSubmorphs to true, there is no 
>>> drawing appearing.
>>>
>>
>> I guess you mean your morph. #ClipsSubmorphs is implemented by 
>> morphs, not by the canvas.
>
> In fact it is a WidgetMorph.
>
>>
>>> I took a look at:
>>>
>>> MorphicCanvas>>clippingByCurrentMorphDo: aBlock
>>>
>>>     * my drawable answers true to clipsSubmorphsReally
>>>
>>
>> You should not redefine this method. Your morph should only define 
>> #clipsSubmorphs.
>
> I did not.
>
>
>> Vector canvas can clip morphs to the arbitrary shape of the outer 
>> morph. But it has a limitation: In a containment branch, there can be 
>> only one morph that clips submorphs. Do you need more than one 
>> clipping morph? Can you provide an example showing the problem you 
>> see, so I can reproduce it?
>
>
> In short, I have a LayoutMorph into which I add my drawable, a widget 
> morph, then the geometric items are added to this drawable.
>
> I turned the drawable to a MovableMorph, of course the layout does not 
> work as a MoveableMorph does not have the notion of extent, but  the 
> clipping work.
>
> So In my context,clipping does not work with a widget morph but does 
> with a moveable morph, but I can't use that object.
>
> I added (requiresVectorCanvas    ^ true) to my drawable, clippings 
> works ! But it is obviously super slow.
>

Ok! Now I see the problem! It is a bug, and very easy to fix. Just 
delete HybridCanvas>>clipCurrentMorph: . The only implementor that 
actually does something is in VectorCanvas, and it will be called on it 
when appropriate.

I'm posting an update to VectorGraphics.pck.st with this change.

Thanks for reporting. When you find any problem, please help me fully 
understand it, so we can improve the framework. Only resort to a 
workaround when we are sure we can't find a way to fix the problem!

> So likely time to test your plugin.
>

Of course that would also be great!

> Thanks
>
> -- 
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu

Thanks,

-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210607/884f1734/attachment-0001.htm>


More information about the Cuis-dev mailing list