_mouse_y_fraction = yf;
if (notify) {
- _region.note_mouse_position (_mouse_x_fraction, _mouse_y_fraction, set_cursor);
+ if (big_enough_to_trim()) {
+ _region.note_mouse_position (_mouse_x_fraction, _mouse_y_fraction, set_cursor);
+ } else {
+ /* pretend the mouse is in the middle, because this is not big enough
+ to trim right now.
+ */
+ _region.note_mouse_position (0.5, 0.5, set_cursor);
+ }
}
}
(_mouse_x_fraction >= 0.75 && _mouse_x_fraction < 1.0);
}
+bool
+CanvasNoteEvent::big_enough_to_trim () const
+{
+ return (x2() - x1()) > 10; /* canvas units, really pixels */
+}
+
} // namespace Canvas
} // namespace Gnome