Fixed visual glitch when mouse was leaving video display.

Originally committed to SVN as r56.
This commit is contained in:
Niels Martin Hansen 2006-02-01 22:15:21 +00:00
parent c450a5468c
commit b3b9d5e033

View file

@ -223,6 +223,14 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
// Disable when playing // Disable when playing
if (IsPlaying) return; 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 // Right click
if (event.ButtonUp(wxMOUSE_BTN_RIGHT)) { if (event.ButtonUp(wxMOUSE_BTN_RIGHT)) {
wxMenu menu; wxMenu menu;
@ -338,10 +346,8 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
GetTextExtent(text,&tw,&th,NULL,NULL,&font); GetTextExtent(text,&tw,&th,NULL,NULL,&font);
// Inversion // Inversion
bool left = false; bool left = x > w/2;
bool bottom = false; bool bottom = y < h/2;
if (x > w/2) left = true;
if (y < h/2) bottom = true;
// Text draw coords // Text draw coords
int dx = x,dy = y; int dx = x,dy = y;