Drawing a Graphice Segment

J. Landman Gay jacque at hyperactivesw.com
Sat Jul 25 14:44:32 EDT 2015


On 7/25/2015 5:41 AM, Terence Heaford wrote:
> I want to only receive a mouseEnter & mouseLeave when the mouse
> leaves the coloured segment not the overall rect used in creating the
> segment.

This happens automatically if the graphic is a filled, opaque polygon. 
It also works with an oval if the arcAngle is 360 (full circle) but 
fails if it's anything else. It's interesting to note that the 
mouseEnter and mouseLeave are sent correctly if you approach the pie 
slice from the curved edge of the virtual circle; it only fails if 
approaching from the "cut" edges.

There are two ways to write most functions, and in the case of "within" 
the behavior is slightly different. If you use "is within" then the test 
is done against the entire rectangle of the control. If you use 
"within()" the test is done against only the filled portion. "Within()" 
fails in the same way as the mouse messages when applied to an arc. I'd 
say it's a bug.

The color test should work if you don't use a gradient or other graphic 
effects, just a solid fill. Or you might be able to do something fancy 
by faking a pie slice using a freehand graphic with lots of points along 
the curved edge, but that's more math than I can do.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list