Commit 5eddb1f4 authored by charras's avatar charras

fixed flicker when zooming. (wxGTK specific)

parent 37309e1a
...@@ -769,7 +769,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC ) ...@@ -769,7 +769,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
// Under linux, to be tested (could be depend on linux versions // Under linux, to be tested (could be depend on linux versions
// so perhaps could be necessary to set this option at run time. // so perhaps could be necessary to set this option at run time.
#if defined ( __WXMAC__ ) #ifndef __WXMSW__
// Use a pixel based draw to display grid // Use a pixel based draw to display grid
// There is a lot of calls, so the cost is hight // There is a lot of calls, so the cost is hight
// and grid is slowly drawn on some platforms // and grid is slowly drawn on some platforms
...@@ -795,7 +795,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC ) ...@@ -795,7 +795,7 @@ void WinEDA_DrawPanel::DrawBackGround( wxDC* DC )
// But this is fast if the Blit function is fast. Not true on all platforms // But this is fast if the Blit function is fast. Not true on all platforms
// a grid column is drawn; and then copied to others grid columns // a grid column is drawn; and then copied to others grid columns
// this is possible because the grid is drawn only after clearing the screen. // this is possible because the grid is drawn only after clearing the screen.
// under MACOSX, is very slow // under MACOSX, is very slow and seems crash under Linux
ii = 1; ii = 1;
xg = wxRound(ii * screen_grid_size.x); xg = wxRound(ii * screen_grid_size.x);
int x0pos = GRMapX( org.x + xg); int x0pos = GRMapX( org.x + xg);
...@@ -925,6 +925,9 @@ void WinEDA_DrawPanel::OnMouseLeaving( wxMouseEvent& event ) ...@@ -925,6 +925,9 @@ void WinEDA_DrawPanel::OnMouseLeaving( wxMouseEvent& event )
*/ */
void WinEDA_DrawPanel::OnMouseWheel( wxMouseEvent& event ) void WinEDA_DrawPanel::OnMouseWheel( wxMouseEvent& event )
{ {
if( m_IgnoreMouseEvents )
return;
wxRect rect = wxRect( wxPoint( 0, 0), GetClientSize() ); wxRect rect = wxRect( wxPoint( 0, 0), GetClientSize() );
/* Ignore scroll events if the cursor is outside the drawing area. */ /* Ignore scroll events if the cursor is outside the drawing area. */
......
...@@ -26,15 +26,22 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse ) ...@@ -26,15 +26,22 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
{ {
PutOnGrid( &(GetBaseScreen()->m_Curseur) ); PutOnGrid( &(GetBaseScreen()->m_Curseur) );
AdjustScrollBars(); AdjustScrollBars();
DrawPanel->m_IgnoreMouseEvents = true;
DrawPanel->Refresh(); // send OnPaint event DrawPanel->Refresh(); // send OnPaint event
wxSafeYield(); // needed to allow OnPaint event execution here
// wxSafeYield() is better here, but creates flicker under Linux
// because it temporary disables menus and toolbars
// TODO: find a better way to manage refresh screen and mouse move
wxYield(); // needed to allow OnPaint event execution here
DrawPanel->m_IgnoreMouseEvents = false;
/* Move the mouse cursor to the on grid graphic cursor position */ /* Move the mouse cursor to the on grid graphic cursor position */
if( ToMouse == TRUE ) if( ToMouse == TRUE )
{ {
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
} }
} }
/** Adjust the coordinate to the nearest grid value /** Adjust the coordinate to the nearest grid value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment