Circle shaped button question
-
I made a circle shaped button using button LAF. As button object area is a rectangle ,clicking on that area makes button work. But I want the button to work only when it is clicked on the circle area. Is there a way to do this? Thank you.
-
@mehmethand You could use a panel (instead of the button) and only register the click when the cursor is within the circular area - trigonometry time.
-
@d-healey Thank you. I got the idea. But now another question how can I get the mouse coordinate inside a panel?
-
-
I managed to do what I want. Thank you David. Here is the snipset if needed.
HiseSnippet 942.3ocsV02aaSDF+bZ81rggXR7AvZ+AxVrERJC1jFQTZZJKBZWzxnLIDZ5p8k3S87cd9N2tHT+Nu8I.ddNaO6rkMfHlUTRdd6te2yK+NOqPEyzZUAww6oqxYDmO0c9JoIcbJkKISOj37YtGS0FVQPkpCVkS0ZVBwwYmeBU33sKw97pe3.pfJiYspHjSU7X1uvy3lVsy1+m4BwQzD1S4Yc79d6OMVIGqDpR.O63NfjSiOmtjcBEcqmKw4ZSR3FUwbC0vzDmcOPkrZdp5RYk+mx07yDLTXHYNrPUpORIRPDiZIiS4hjYMmaMAVkYsYgcpxBeg6w7D9az2lM9bqgf1H5lOb5sN71YM3MrK7FzAda.RNcfztUP5VtyiK34lVKHd9D2oRn3rfBo8tPoxWRuW2ycrB7PZ5mQOmcTAH7lHB2avf6D.eE8PeeH0qMAWPKBlQkLQvnfl.WxLiUY4JIHDd6bz5swHr90WyLyfri4IpRCWxBWTJiMbkLbYj+e56sDcnplFV8it+YhRFr.fsEPivSXwlveG.B7wjx0398a7DSZXTqhGw3KSMgQ+Atwd7EAgMVNkBqVXTvnQACi78fsbi6YAKA2xq78XBMy2yeSNcYJ2zAYSDBdtl8eCbWsVp4XUolMlJDmAsxs4F1EPtDyOX9NczwTSZe8KJLgM+K7s1rudu6Zio+Ki9p+QeVEgX.SRoe+n2wIaYwpU2j8pBKVviOuJMYMWvxwBaXzC877uJ.dpOc3SyQIPIOQYXOVFZWW+q7CdaSKVrQaX6UgRHXEazLxMT7gBLTVlcFq3NPOK1O03HLvr9Tn66eJrKIQbU2dGGUxoRt4w4L46i5fT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