Group with controls including effects

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mhsu
Posts: 8
Joined: Thu Aug 04, 2016 2:33 pm

Group with controls including effects

Post by mhsu » Wed Apr 26, 2023 8:06 pm

Is there a way to get groups to consider the size of effects (eg Drop Shadow, OuterGlow, etc.) of controls?
Livecode groups will cut off the shadow effect if the group's margin isn't large enough, and groups don't take any effect size into account.

I see that there are a couple feature requests that look like they were not implemented:
#8688 and #10360

Barring that, is there a way to get the rect of a control including any effects ?
Both the rect and the effective rect of the control do not include any effects.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9454
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Group with controls including effects

Post by richmond62 » Wed Apr 26, 2023 8:31 pm

I am not sure what you mean: here are 2 groups that are exactly the same except in the lower one
the group's border is visible.

You will see that the outer glow effects of the images extend beyond the borders of the group
without any problems:
-
SShot 2023-04-26 at 22.29.58.png
-
Attachments
creepy shadows.livecode.zip
Stack.
(22.76 KiB) Downloaded 53 times

mhsu
Posts: 8
Joined: Thu Aug 04, 2016 2:33 pm

Re: Group with controls including effects

Post by mhsu » Wed Apr 26, 2023 9:33 pm

In your example, the effects are applied to the group. I'm talking about when the controls have the effect, and the group itself does not.

This becomes an issue if you have a group that has some controls with a shadow effect, and others that don't have a shadow. In that case, you can't apply the shadow to the entire group, you have to apply it to the controls inside the group, but then you run into the issue where the group cuts off the shadow.
Attachments
ungrouped_effect-min.png
grouped_effect-min.png

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4027
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Group with controls including effects

Post by bn » Wed Apr 26, 2023 11:23 pm

Hi mhsu,

You could try to set the "clipsToRect" property of the group to true and then manually adjust the dimensions of the group.
You can turn this property on in the Property Inspector for the group in the "Position" tab.

ClipsToRect is similar to "lockLoc" but you can change the dimensions of the group manually.

But this is not done automatically since drop shadow etc. are not part of any formatted width/height of a control.

Kind regards
Bernd

mhsu
Posts: 8
Joined: Thu Aug 04, 2016 2:33 pm

Re: Group with controls including effects

Post by mhsu » Wed Apr 26, 2023 11:50 pm

OK, yeah, I guess that's the only solution. Thanks!

Post Reply

Return to “Talking LiveCode”