Creates a one-element array with a coordinate; if 'imp' is non-null converts from a screen coordinate to an image (offscreen) coordinate. The array can be used for adding to an existing point selection
(double value, ImagePlus imp, boolean isY)
| 206 | * converts from a screen coordinate to an image (offscreen) coordinate. |
| 207 | * The array can be used for adding to an existing point selection */ |
| 208 | static float[] makeXorYArray(double value, ImagePlus imp, boolean isY) { |
| 209 | if (imp != null) { |
| 210 | ImageCanvas canvas = imp.getCanvas(); |
| 211 | if (canvas != null) { //offset 0.5 converts from area to pixel center coordinates |
| 212 | value = (isY ? canvas.offScreenYD((int)value) :canvas.offScreenXD((int)value)) - 0.5; |
| 213 | if (!magnificationForSubPixel(canvas.getMagnification())) |
| 214 | value = Math.round(value); |
| 215 | } |
| 216 | } |
| 217 | return new float[] {(float)value}; |
| 218 | } |
| 219 | |
| 220 | void handleMouseMove(int ox, int oy) { |
| 221 | } |
no test coverage detected