likely fix for cases where a button release event falls through from the canvas to the editor, during a drag

The drag code expects coordinates in canvas coordinates, but we were not translating them at the editor level (canvas event handling
does do this, but cannot affect the situation if the event falls through to the editor)
This commit is contained in:
Paul Davis 2020-03-25 15:30:52 -06:00
parent 4151ec1907
commit 5d1b75bd4f
1 changed files with 9 additions and 1 deletions

View File

@ -188,7 +188,15 @@ Editor::track_canvas_button_release_event (GdkEventButton *event)
{
if (!Keyboard::is_context_menu_event (event)) {
if (_drags->active ()) {
_drags->end_grab ((GdkEvent*) event);
GdkEvent copy = *((GdkEvent*) event);
Duple winpos = Duple (event->x, event->y);
Duple where = _track_canvas->window_to_canvas (winpos);
copy.button.x = where.x;
copy.button.y = where.y;
_drags->end_grab (&copy);
}
}
return false;