Clipping/cropping a group

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Clipping/cropping a group

Post by Klaus » Sat Oct 12, 2024 8:44 pm

Klaus wrote:
Sat Oct 12, 2024 3:21 pm
Hi Bernd,
tried that, but didn't work, since setting the height will not change the topleft of the group.
...
Ouch, that was because my group was LOCLOCKED! :oops:

Anyway, after 25 years of working with MC, RR and LC, I learned something new -> layerClipRect
That does EXACTLY what i wanted to achieve with a one-liner. :D

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: Clipping/cropping a group

Post by bn » Sat Oct 12, 2024 10:32 pm

Hi Klaus,
Anyway, after 25 years of working with MC, RR and LC, I learned something new -> layerClipRect
That does EXACTLY what i wanted to achieve with a one-liner. :D
I tried "layerClipRect" on the group and it worked, I had not heard of that property either.

KInd regards
Bernd

Edited: Klaus not "Klause".
Last edited by bn on Sun Oct 13, 2024 9:53 am, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: Clipping/cropping a group

Post by dunbarx » Sun Oct 13, 2024 3:49 am

Ouch.

How many other little known words exist in the LC lexicon that would solve problems with a single line?

Klaus, how did you find it? By asking ChatGPT to find a native LC word that would solve your problem?

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: Clipping/cropping a group

Post by dunbarx » Sun Oct 13, 2024 4:02 am

Klaus.

The layerClipRect only affects the visibly rendered part of a control. It does not change the actual rect of that control. In your first post, you mentioned that what you were looking for could easily be done by dragging handles with the mouse, but not under script control.

But dragging handles actually changes the rect of the control of interest. The layerClipRect does not do that, though it looks the same. So did you really want that very first action?

Here is something, if you set the layerClipRect on a control, and then go to a different app, like the finder, that control reverts visibly to its original rect. It "restores" itself when LC is back in front.

Craig

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Clipping/cropping a group

Post by Klaus » Sun Oct 13, 2024 8:50 am

Hi Craig,

I got a hint from the mailing-list and I am only interested in the VISIBLE result.
I know what "layerClipRect" does and this is the right thing for me currently.

Best

Klaus

Post Reply