[Cuis-dev] Clipping operation

Juan Vuletich juan at jvuletich.org
Thu Apr 30 11:50:49 PDT 2020


On 4/30/2020 1:04 PM, Hilaire Fernandes via Cuis-dev wrote:
>
> Ah Ah, I have a slightly different approach.
>
> I created a ClipperMorph kind of LayoutMorph then create one class 
> side method.
>
> clip: aMorphToClip
>     ^ self newColumn
>         addMorphUseAll: aMorphToClip;
>         yourself
>
> and the needed clipsLastMorph method, that's all.
>
> As you mentioned, the added morphs are clipped.
> Problem solved.
>
> Hilaire
>
> Le 30/04/2020 à 13:36, Thierry Goubier via Cuis-dev a écrit :
>> I had a similar issue, and what I did is to create an InsideMorph, as
>> a subclass of Morph.
>>
>> a ViewportMorph is at the same level than scrollbars (in my case), and
>> has a single submorph: an InsideMorph. The InsideMorph can have many
>> submorphs.
>> The ViewportMorph clips the InsideMorph. Like that, the submorphs of
>> the InsideMorph are all clipped to the ViewportMorph bounds.
>>
>> InsideMorph has only two methods: #drawOn: (that does nothing, but
>> turns off the Morph drawing code), and #morphExtent which returns its
>> owner extent (ViewportMorph).
> -- 
> GNU Dr. Geo
> http://drgeo.eu

Glad to see you found a way to make it work.

Still, if you'd rather have better clipping support, as I said in 
another email, this is a good time to add that to Cuis.

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/20200430/74c73ec2/attachment.htm>


More information about the Cuis-dev mailing list