[Cuis-dev] Clipping operation

Hilaire Fernandes hilaire at drgeo.eu
Thu Apr 30 09:04:01 PDT 2020


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200430/51e4c04c/attachment.htm>


More information about the Cuis-dev mailing list