Fix zoom issue on MSWin (wxCanvas requires focus)

This commit is contained in:
Mário Luzerio 2016-03-02 07:50:32 +11:00 committed by Cirilo Bernardo
parent d0a2080823
commit d4655020f9
1 changed files with 6 additions and 0 deletions

View File

@ -508,12 +508,18 @@ void PANEL_PREV_3D::UpdateModelName( wxString const& aModelName )
preview->SetSizer( ws );
preview->Layout();
ws->FitInside( preview );
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
// in order to receive mouse events. Otherwise, the user has to click somewhere on
// the canvas before it will respond to mouse wheel events.
canvas->SetFocus();
return;
}
canvas->Set3DModel( *model );
canvas->Refresh();
canvas->Update();
canvas->SetFocus();
return;
}