From b3b9d5e033fada46aa120ee5d1b669ac8dd77086 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 1 Feb 2006 22:15:21 +0000 Subject: [PATCH] Fixed visual glitch when mouse was leaving video display. Originally committed to SVN as r56. --- core/video_display.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/video_display.cpp b/core/video_display.cpp index 6b9df5fd6..4943e32de 100644 --- a/core/video_display.cpp +++ b/core/video_display.cpp @@ -223,6 +223,14 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { // Disable when playing if (IsPlaying) return; + if (event.Leaving()) { + // OnMouseLeave isn't called as long as we have an OnMouseEvent + // Just check for it and call it manually instead + OnMouseLeave(event); + event.Skip(true); + return; + } + // Right click if (event.ButtonUp(wxMOUSE_BTN_RIGHT)) { wxMenu menu; @@ -338,10 +346,8 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { GetTextExtent(text,&tw,&th,NULL,NULL,&font); // Inversion - bool left = false; - bool bottom = false; - if (x > w/2) left = true; - if (y < h/2) bottom = true; + bool left = x > w/2; + bool bottom = y < h/2; // Text draw coords int dx = x,dy = y;