Cannot undo a graphic opaque setting

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Cannot undo a graphic opaque setting

Post by dunbarx » Wed May 11, 2022 7:26 pm

I made a polygon graphic of a few sides. I set its "opaque" property, and the "open" side was drawn, closing the shape.

This is not at all what I wanted, which was simply to be able to grab that control from its interior with the pointer tool, but still as an open shape. Clearing the state of the "opaque" button does not revert the graphic back to its original form.

I know that LC is not a CAD program.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Cannot undo a graphic opaque setting

Post by FourthWorld » Wed May 11, 2022 8:28 pm

AFAIK that's how polys have always been handled in the engine since the very beginning back in the '90s.

The best I can come up with as a workaround would be a second object: the interior set as you have it, opacity with closed border but linesize set to 0, with a copy set the other way, with no opacity and linesize set to whatever you need to display.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Cannot undo a graphic opaque setting

Post by dunbarx » Thu May 12, 2022 1:45 am

Richard.

Thanks, Kludgeing is my forte.

I just was wondering why, since it does not seem to be an OS thing. Or am I wrong? But if not wrong, then why? Some inaccessible property of that graphic is changed permanently deep down.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Cannot undo a graphic opaque setting

Post by FourthWorld » Thu May 12, 2022 6:28 am

Not an OS thing, but a design decision that goes back as far as I can recall. It's in the engine's graphics routines, independent of the OS.

I'd wager it could be changed. And I'd wager it would be so far behind other priorities it wouldn't be changed in any practical time frame.

If you need that appearance you could either do a workaround like the one I outlined above, or write a new polygon shape object as a widget with LC Builder.

Can't think of another solution.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Cannot undo a graphic opaque setting

Post by richmond62 » Thu May 12, 2022 6:48 am

You could import a hollow SVG into the svg widget.

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

Re: Cannot undo a graphic opaque setting

Post by richmond62 » Mon May 16, 2022 12:14 pm

simply to be able to grab that control from its interior with the pointer tool, but still as an open shape
Didn't have any problem with the left-hand graphic

[MacOS 10.7.5 / LC 8.1.10]:
-
Screen Shot 2022-05-16 at 2.10.15 PM.png
Attachments
shapely.livecode.zip
Stack.
(782 Bytes) Downloaded 79 times

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: Cannot undo a graphic opaque setting

Post by LCMark » Mon May 16, 2022 1:05 pm

The polygon does not have to have a closed border to be opaque - its just that the engine (whether helpfully or not - depending on your point of view) will implicitly 'close' the points of a 'polygon' when you set the opaque to true (or edit the points property):

You can avoid this though - create your polygon with the polygon tool
Change the style to curve
Turn opaque on - no line is added
Switch the style back to polygon

Basically if style of the graphic is polygon and you 'set the opaque to true', then it adds a closing line; if the style of a graphic is a curve and you 'set the opaque to true' then it does not.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Cannot undo a graphic opaque setting

Post by dunbarx » Mon May 16, 2022 3:01 pm

LCMark:

Aha. A curve graphic comprised of a handful of straight sides. Genius.

Craig

Post Reply

Return to “Talking LiveCode”