Skip to content
Extraits de code Groupes Projets
Valider 09962a56 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Use the last valid mouse position for VideoDisplay::GetMousePosition

On Windows opening the context menu triggers a mouse leave event, which
invalidates the current mouse position, so the Copy coordinates to
Clipboard command didn't work.
parent fd447927
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -351,7 +351,7 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { ...@@ -351,7 +351,7 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
if (event.ButtonDown()) if (event.ButtonDown())
SetFocus(); SetFocus();
mouse_pos = event.GetPosition(); last_mouse_pos = mouse_pos = event.GetPosition();
if (tool) if (tool)
tool->OnMouseEvent(event); tool->OnMouseEvent(event);
...@@ -424,7 +424,7 @@ bool VideoDisplay::ToolIsType(std::type_info const& type) const { ...@@ -424,7 +424,7 @@ bool VideoDisplay::ToolIsType(std::type_info const& type) const {
} }
Vector2D VideoDisplay::GetMousePosition() 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() { void VideoDisplay::Unload() {
......
...@@ -83,7 +83,7 @@ class VideoDisplay : public wxGLCanvas { ...@@ -83,7 +83,7 @@ class VideoDisplay : public wxGLCanvas {
/// be the same as the actual client size of the display /// be the same as the actual client size of the display
wxSize videoSize; 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 /// Screen pixels between the left of the canvas and the left of the video
int viewport_left; int viewport_left;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter