diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 0db6830ab..5df711cb1 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -351,7 +351,7 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { if (event.ButtonDown()) SetFocus(); - mouse_pos = event.GetPosition(); + last_mouse_pos = mouse_pos = event.GetPosition(); if (tool) tool->OnMouseEvent(event); @@ -424,7 +424,7 @@ bool VideoDisplay::ToolIsType(std::type_info const& type) const { } Vector2D VideoDisplay::GetMousePosition() const { - return mouse_pos ? tool->ToScriptCoords(mouse_pos) : mouse_pos; + return last_mouse_pos ? tool->ToScriptCoords(last_mouse_pos) : last_mouse_pos; } void VideoDisplay::Unload() { diff --git a/aegisub/src/video_display.h b/aegisub/src/video_display.h index a6a73fded..5e5bf91f2 100644 --- a/aegisub/src/video_display.h +++ b/aegisub/src/video_display.h @@ -83,7 +83,7 @@ class VideoDisplay : public wxGLCanvas { /// be the same as the actual client size of the display wxSize videoSize; - Vector2D mouse_pos; + Vector2D last_mouse_pos, mouse_pos; /// Screen pixels between the left of the canvas and the left of the video int viewport_left;