| 208 | } |
| 209 | |
| 210 | static bool screen_to_image(const vapp_state& app, float sx, float sy, |
| 211 | float& ix, float& iy) { |
| 212 | if (app.canvas_w <= 0 || app.canvas_h <= 0) return false; |
| 213 | ix = (sx - app.canvas_x) / app.canvas_w * app.frame.width; |
| 214 | iy = (sy - app.canvas_y) / app.canvas_h * app.frame.height; |
| 215 | return ix >= 0 && iy >= 0 && ix < app.frame.width && iy < app.frame.height; |
| 216 | } |
| 217 | |
| 218 | static void create_tracker(vapp_state& app) { |
| 219 | if (app.visual_only) { |