Closed jagger23 closed 1 year ago
I don't understand what do you want to achieve. Are trying to detects taps on single hex?
I am doing flutter web.
I want to highlight the hex when someone moves the mouse over it.
A hit test would be a simple way to find out which hex it is over.
On Jul 6, 2021, at 3:08 PM, orlikraf @.***> wrote:
I don't understand what do you want to achieve. Are trying to detects taps on single hex?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rSquared-software/flutter-hexagon/issues/14#issuecomment-875047559, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNHG42R4SOQJGWGPRQS2Y3TWNPC7ANCNFSM472XQZ7Q.
Have you thought about having the child you put into the hexagon being responsible of detecting the hover gesture?
The MouseRegion
widget should be useful for this. Hopefully the hexagon should clip the detection zone to its shape so you won't get false calls outside it. But it have to be confirmed. I did noticed that InkWell
highlight isn't clipping at all.
No I didn’t think to try that. I will see if that will work for me.
Thanks
On Jul 8, 2021, at 7:14 AM, orlikraf @.***> wrote:
Have you thought about having the child you put into the hexagon being responsible of detecting the hover gesture? The MouseRegion widget should be useful for this. Hopefully the hexagon should clip the detection zone to its shape so you won't get false calls outside it. But it have to be confirmed. I did noticed that InkWell highlight isn't clipping at all.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rSquared-software/flutter-hexagon/issues/14#issuecomment-876388729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALNHG47A4TWGCQFNSXIA26DTWWJC3ANCNFSM472XQZ7Q.
Seems like the hitTest method is not available on Hexagon object but it is on CustomPainter so it should be possible to determine if a given x,y would match.