Commit 148baffd authored by Marco Serantoni's avatar Marco Serantoni

OSX implementation of wxOverlay (speedups board operations) and cleanup

parent 27e9eedd
......@@ -8,6 +8,7 @@
#include "colors.h"
#include "base_struct.h"
#include <wx/overlay.h>
class WinEDA_DrawFrame;
class BASE_SCREEN;
......@@ -60,6 +61,10 @@ public:
int m_CursorLevel; // Index for cursor redraw in XOR
// mode
#ifdef __WXMAC__
// MAC Uses overlay to workaround the wxINVERT and wxXOR miss
wxOverlay m_overlay;
#endif
/* Cursor management (used in editing functions) */
/* Mouse capture move callback function prototype. */
......
......@@ -362,11 +362,17 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( DrawPanel->ManageCurseur )
{
#ifdef __WXMAC__
DrawPanel->Refresh();
DrawPanel->Update();
#endif
wxDCOverlay oDC( DrawPanel->m_overlay, DC );
oDC.Clear();
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
#else
DrawPanel->ManageCurseur( DrawPanel, DC, TRUE );
#endif
}
#ifdef __WXMAC__
else
DrawPanel->m_overlay.Reset();
#endif
}
if( hotkey )
......
......@@ -571,11 +571,8 @@ void DrawModuleOutlines( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module )
if( g_Show_Pads_Module_in_Move )
{
pad_fill_tmp = DisplayOpt.DisplayPadFill;
#ifndef __WXMAC__
DisplayOpt.DisplayPadFill = true;
#else
DisplayOpt.DisplayPadFill = false;
#endif
pt_pad = module->m_Pads;
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{
......
......@@ -18,6 +18,7 @@
#include "module_editor_frame.h"
#include "pcbplot.h"
#include "protos.h"
#include <wx/overlay.h>
extern int g_DrawDefaultLineThickness; // Default line thickness, used to draw Frame references
......@@ -53,6 +54,12 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
module->Draw( DrawPanel, DC, GR_OR );
}
#ifdef __WXMAC__
DrawPanel->m_overlay.Reset();
wxDCOverlay overlaydc( DrawPanel->m_overlay, DC );
overlaydc.Clear();
#endif
screen->ClrRefreshReq();
if( DrawPanel->ManageCurseur )
......@@ -83,6 +90,12 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawGeneralRatsnest( DC );
#ifdef __WXMAC__
DrawPanel->m_overlay.Reset();
wxDCOverlay overlaydc( DrawPanel->m_overlay, DC );
overlaydc.Clear();
#endif
GetScreen()->ClrRefreshReq();
if( DrawPanel->ManageCurseur )
......
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