Commit bf67eed7 authored by Marco Serantoni's avatar Marco Serantoni

OSX adjustments - grid fix - speedup of refresh

parent 5b832a66
...@@ -117,6 +117,11 @@ void WinEDA_DrawPanel::DrawCursor( wxDC* aDC, int aColor ) ...@@ -117,6 +117,11 @@ void WinEDA_DrawPanel::DrawCursor( wxDC* aDC, int aColor )
if( m_CursorLevel != 0 || aDC == NULL ) if( m_CursorLevel != 0 || aDC == NULL )
return; return;
#ifdef __WXMAC__
SetCursor(*wxCROSS_CURSOR);
return;
#endif
wxPoint Cursor = GetScreen()->m_Curseur; wxPoint Cursor = GetScreen()->m_Curseur;
GRSetDrawMode( aDC, GR_XOR ); GRSetDrawMode( aDC, GR_XOR );
...@@ -812,16 +817,32 @@ void WinEDA_DrawPanel::DrawGrid( wxDC* DC ) ...@@ -812,16 +817,32 @@ void WinEDA_DrawPanel::DrawGrid( 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__ )
wxWindowUpdateLocker( this ); // under macOSX: drawings are faster with this
#endif
/* The bitmap grid drawing code below cannot be used when wxDC scaling is used /* The bitmap grid drawing code below cannot be used when wxDC scaling is used
* as it does not scale the grid bitmap properly. This needs to be fixed. * as it does not scale the grid bitmap properly. This needs to be fixed.
*/ */
#if defined( __WXMAC__ ) || defined( USE_WX_ZOOM ) #if defined( __WXMAC__ ) && !defined( USE_WX_ZOOM )
// Use a pixel based draw to display grid
// When is not used USE_WX_ZOOM
for( ii = 0; ; ii++ )
{
xg = wxRound( ii * screen_grid_size.x );
if( xg > size.x )
break;
xpos = org.x + xg;
xpos = GRMapX( xpos );
for( jj = 0; ; jj++ )
{
yg = wxRound( jj * screen_grid_size.y );
if( yg > size.y )
break;
ypos = org.y + yg;
DC->DrawPoint( xpos, GRMapY( ypos ) );
}
}
#endif
#if defined( USE_WX_ZOOM )
// 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
......
...@@ -113,11 +113,6 @@ void D_PAD::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDraw_mode, ...@@ -113,11 +113,6 @@ void D_PAD::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDraw_mode,
else else
drawInfo.m_ShowPadFilled = false; drawInfo.m_ShowPadFilled = false;
#if defined(PCBNEW) || defined(__WXMAC__)
if( m_Flags & IS_MOVED || !DisplayOpt.DisplayPadFill )
drawInfo.m_ShowPadFilled = false;
#endif
if( m_Masque_Layer & LAYER_FRONT ) if( m_Masque_Layer & LAYER_FRONT )
{ {
color = brd->GetVisibleElementColor( PAD_FR_VISIBLE ); color = brd->GetVisibleElementColor( PAD_FR_VISIBLE );
......
...@@ -361,6 +361,10 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -361,6 +361,10 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
{ {
#ifdef __WXMAC__
DrawPanel->Refresh();
DrawPanel->Update();
#endif
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE ); DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
} }
} }
......
...@@ -281,9 +281,4 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -281,9 +281,4 @@ void WinEDA_PcbFrame::SetToolbars()
PrepareLayerIndicator(); PrepareLayerIndicator();
DisplayUnitsMsg(); DisplayUnitsMsg();
#ifdef __WXMAC__
// Needed to avoid cursor tail
this->Refresh();
#endif
} }
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