Cannot click on the whole shape of a polygon

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
gilgml
Posts: 26
Joined: Wed Jun 16, 2021 3:35 am

Cannot click on the whole shape of a polygon

Post by gilgml »

Hello to everybody !
Little problem, only the "corners", say the 'spikes' of a polygon triggers on mouse down.
I don't know if it is the standard behavior, or if there is a workaround...

Thanks in advance.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cannot click on the whole shape of a polygon

Post by Klaus »

Hi gilgml,

this is correct beahvior UNLESS you have checked OPAQUE for that graphic. :D


Best

Klaus
gilgml
Posts: 26
Joined: Wed Jun 16, 2021 3:35 am

Re: Cannot click on the whole shape of a polygon

Post by gilgml »

Hi Klaus, thank you for the helping hand :D
It doesn't work, even with Opaque checked :(
Attachments
Capture d’écran 2021-07-28 à 16.00.31.png
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Cannot click on the whole shape of a polygon

Post by Klaus »

Bonjour gilgml,

that is very strange, it works here with an OPAQUE polygon!? :shock:
macOS 10.14.6, LC 9.6.2.

Best

Klaus
polygon_click.jpg
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot click on the whole shape of a polygon

Post by dunbarx »

Hi.

I see what Klaus sees, setting the "opaque" property allows a message to be sent when clicking on the interior of the shape. This has been true forever.

Know that a regular polygon has this property set by default, whereas the one you draw using the polygon graphic tool has the property cleared by default.

Mac OS.

Craig
gilgml
Posts: 26
Joined: Wed Jun 16, 2021 3:35 am

Re: Cannot click on the whole shape of a polygon

Post by gilgml »

OK then.
Drew some others ( with polygon graphic tool ) ... it works.
The one not OK was badly 'drawned' ( the polygon circumference was not closed ( even one pix not closed ) )

Thank you for your support :)
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot click on the whole shape of a polygon

Post by dunbarx »

Hi.

When you set the opaque of a hand-drawn polygon, LC closes the shape. It adds one more line to "the points" property to do that, which is why clearing the opaque property does not restore the original open version. You would have to save those original points and restore manually.

I don't think you can have it both ways, that is, with a unclosed shape and opaque set. You can kludge this for visual effect in many ways, though. And I seem to remember a more direct method to have an open shape with its opaque set, but am not sure about that.

Craig
Post Reply