In an application, I want to be able to click in an image that is displayed. The image should be redrawn with the pixel that was clicked in the center. As a newbie, I thought MouseArea was promising. But I don’t see this functionality. on_press doesn’t tell me where the click was.
Is there a way to achieve this?
You can with this crate I recently made:
Check out the examples folder
Nice.
It surprises me though to see that there is a on_press_with but no other functions (like on_right_press_with and on_release_with).
And I would like to have a line of documentation that states that the position is relative to the area (and not to the window or the screen).
Well, I made that in less than 15 mins but on Discord I did mention to whoever last needed it that it would have been nice to include other actions. I just haven’t had the time, but I might add those in the future.
I can’t think of an use case that would warrant knowing the position relative to the window or the screen, so instead of making it very generic I tried to cover the more common use case in a straightforward manner.