Searge-DP / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

Image Mouse Coords in Lua #445

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Could we make it possible to retrieve the IMAGE mouse/pixel coords via scripts, 
that is; the numbers displayed in the statusbar.

I've written a (key activated only) "magic brush-grab" script. It does a 
flood-search from the mouse-pointer location, now read by waitinput(), and 
makes a brush of all non-bg contiguous pixels. But right now this does not work 
in zoomed-in mode coz I can't get right image-coords.

Original issue reported on code.google.com by annas...@hotmail.com on 15 Jul 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Done in r1819, they are 2 added arguments for waitinput. I didn't put a 
clipping (return -1,-1) when it's outside of the visible image, like hidden by 
menu, or in the black space to the right of an image smaller than screen. I 
think that sometimes you need image-coords even outside the boundaries, like 
the brush-rotating tool, for example. Let me know if such bound-checking is 
necessary.

Original comment by yrizoud on 16 Jul 2011 at 7:21