diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 57d45d18ba..46e712567f 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -364,7 +364,7 @@ bool EDA_DRAW_PANEL_GAL::SwitchBackend( GAL_TYPE aGalType ) break; default: - assert( false ); + wxASSERT( false ); // warn about unhandled GAL canvas type, but continue with the fallback option case GAL_TYPE_NONE: @@ -387,7 +387,7 @@ bool EDA_DRAW_PANEL_GAL::SwitchBackend( GAL_TYPE aGalType ) // from the defaults m_options.NotifyChanged(); - assert( new_gal ); + wxASSERT( new_gal ); delete m_gal; m_gal = new_gal; diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index b5f3e4f67e..d9834b469c 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -351,7 +351,11 @@ void CAIRO_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControl void CAIRO_GAL::DrawBitmap( const BITMAP_BASE& aBitmap ) { int ppi = aBitmap.GetPPI(); - double worldIU_per_mm = 1/(worldUnitLength/2.54)/1000; + // We have to calculate the pixel size in users units to draw the image. + // worldUnitLength is the user unit in GAL unit value + // (GAL unit = 0.1 inch in nanometer = 2.54/1000 in mm). + // worldUnitLength * 1000 / 2.54 is the user unit in mm + double worldIU_per_mm = 1/( worldUnitLength / 0.00254 ); double pix_size_iu = worldIU_per_mm * ( 25.4 / ppi ); int w = aBitmap.GetSizePixels().x; int h = aBitmap.GetSizePixels().y; @@ -1202,5 +1206,5 @@ unsigned int CAIRO_GAL::getNewGroupNumber() void CAIRO_GAL::EnableDepthTest( bool aEnabled ) { - + } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 429660b761..161a114d12 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1003,8 +1003,15 @@ void OPENGL_GAL::DrawBitmap( const BITMAP_BASE& aBitmap ) { int ppi = aBitmap.GetPPI(); - double w = (double) aBitmap.GetSizePixels().x / (double) ppi / worldUnitLength * 10.0; // no idea where the factor 10 comes from... - double h = (double) aBitmap.GetSizePixels().y / (double) ppi / worldUnitLength * 10.0; + // We have to calculate the pixel size in users units to draw the image. + // worldUnitLength is the user unit in GAL unit value + // (GAL unit = 2.54/1e9 in meter). + // worldUnitLength * 1000 / 2.54 is the user unit in mm + double worldIU_per_mm = 1.0 / ( worldUnitLength / 0.00254 ); + double pix_size_iu = worldIU_per_mm * ( 25.4 / ppi ); + + double w = (double) aBitmap.GetSizePixels().x * pix_size_iu; + double h = (double) aBitmap.GetSizePixels().y * pix_size_iu; auto xform = currentManager->GetTransformation(); diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index fa4fbb50fd..75fd45c7ee 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -221,16 +221,13 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, m_FramePos.x = m_FramePos.y = 0; m_FrameSize.y -= m_MsgFrameHeight; - printf("calling createCanvas\n"); - createCanvas(); - printf("Canvas %p\n", m_canvas); - m_messagePanel = new EDA_MSG_PANEL( this, -1, wxPoint( 0, m_FrameSize.y ), wxSize( m_FrameSize.x, m_MsgFrameHeight ) ); m_messagePanel->SetBackgroundColour( COLOR4D( LIGHTGRAY ).ToColour() ); } + EDA_DRAW_FRAME::~EDA_DRAW_FRAME() { delete m_socketServer; @@ -652,7 +649,7 @@ void EDA_DRAW_FRAME::SetNoToolSelected() // Change GAL canvas cursor if requested. if( IsGalCanvasActive() ) defaultCursor = GetGalCanvas()->GetDefaultCursor(); - + SetToolID( ID_NO_TOOL_SELECTED, defaultCursor, wxEmptyString ); } @@ -1045,7 +1042,7 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable ) GetGalCanvas()->SetEvtHandlerEnabled( aEnable ); - + // Reset current tool on switch(); SetNoToolSelected(); @@ -1067,7 +1064,7 @@ bool EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType ) } -EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting() +EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting() { EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; wxConfigBase* cfg = Kiface().KifaceSettings(); diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index 2147cf8bc2..2afb08cb3a 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -242,6 +242,18 @@ static EDA_HOTKEY HkEditCut( _HKI( "Cut" ), HK_EDIT_CUT, GR_KB_CTRL + 'X', (int) static EDA_HOTKEY HkEditCopy( _HKI( "Copy" ), HK_EDIT_COPY, GR_KB_CTRL + 'C', (int) wxID_COPY ); static EDA_HOTKEY HkEditPaste( _HKI( "Paste" ), HK_EDIT_PASTE, GR_KB_CTRL + 'V', (int) wxID_PASTE ); +static EDA_HOTKEY HkCanvasOpenGL( _HKI( "Switch to Modern Toolset with hardware-accelerated graphics (recommended)" ), + HK_CANVAS_OPENGL, +#ifdef __WXMAC__ + GR_KB_ALT + +#endif + WXK_F11, ID_MENU_CANVAS_OPENGL ); +static EDA_HOTKEY HkCanvasCairo( _HKI( "Switch to Modern Toolset with software graphics (fall-back)" ), + HK_CANVAS_CAIRO, +#ifdef __WXMAC__ + GR_KB_ALT + +#endif + WXK_F12, ID_MENU_CANVAS_CAIRO ); // List of common hotkey descriptors static EDA_HOTKEY* common_Hotkey_List[] = @@ -320,6 +332,8 @@ static EDA_HOTKEY* schematic_Hotkey_List[] = &HkLeaveSheet, &HkDeleteNode, &HkHighlightConnection, + &HkCanvasCairo, + &HkCanvasOpenGL, NULL }; @@ -624,12 +638,15 @@ bool SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, case HK_ROTATE: // Rotate schematic item. case HK_EDIT_COMPONENT_WITH_LIBEDIT: // Call Libedit and load the current component case HK_AUTOPLACE_FIELDS: // Autoplace all fields around component + case HK_CANVAS_CAIRO: + case HK_CANVAS_OPENGL: { - // force a new item search on hot keys at current position, + // force a new item search on hot keys at current position, // if there is no currently edited item, // to avoid using a previously selected item if( ! itemInEdit ) screen->SetCurItem( NULL ); + EDA_HOTKEY_CLIENT_DATA data( aPosition ); cmd.SetInt( hotKey->m_Idcommand ); cmd.SetClientObject( &data ); diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h index 239f064bc4..d3b068b63f 100644 --- a/eeschema/hotkeys.h +++ b/eeschema/hotkeys.h @@ -79,7 +79,9 @@ enum hotkey_id_commnand { HK_DELETE_NODE, HK_AUTOPLACE_FIELDS, HK_UPDATE_PCB_FROM_SCH, - HK_SELECT_ITEMS_ON_PCB + HK_SELECT_ITEMS_ON_PCB, + HK_CANVAS_OPENGL, + HK_CANVAS_CAIRO, }; // List of hotkey descriptors for Eeschema diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index f38a88d4ed..5ff0c5f63f 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -647,6 +647,20 @@ static void preparePreferencesMenu( SCH_EDIT_FRAME* aFrame, wxMenu* aParentMenu aParentMenu->AppendSeparator(); + wxString text = AddHotkeyName( _( "Modern Toolset (&Accelerated)" ), g_Eeschema_Hokeys_Descr, + HK_CANVAS_OPENGL ); + AddMenuItem( aParentMenu, ID_MENU_CANVAS_OPENGL, text, + _( "Use Modern Toolset with hardware-accelerated graphics (recommended)" ), + KiBitmap( tools_xpm ), wxITEM_RADIO ); + + text = AddHotkeyName( _( "Modern Toolset (Fallba&ck)" ), g_Eeschema_Hokeys_Descr, + HK_CANVAS_CAIRO ); + AddMenuItem( aParentMenu, ID_MENU_CANVAS_CAIRO, text, + _( "Use Modern Toolset with software graphics (fall-back)" ), + KiBitmap( tools_xpm ), wxITEM_RADIO ); + + aParentMenu->AppendSeparator(); + // Import/export AddMenuItem( aParentMenu, ID_CONFIG_SAVE, _( "&Save Project File..." ), _( "Save project preferences into a project file" ), diff --git a/eeschema/onrightclick.cpp b/eeschema/onrightclick.cpp index 3a42388d62..eebcfc717e 100644 --- a/eeschema/onrightclick.cpp +++ b/eeschema/onrightclick.cpp @@ -143,7 +143,7 @@ bool SCH_EDIT_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* PopMenu ) item = LocateAndShowItem( aPosition, SCH_COLLECTOR::AllItemsButPins, 0, &actionCancelled ); printf("Locateandshow %d %d item %p type %d\n", aPosition.x, aPosition.y, - item, item ? item->Type() : 0 ); fflush(0); + item, item ? item->Type() : 0 ); fflush(0); // If the clarify item selection context menu is aborted, don't show the context menu. if( item == NULL && actionCancelled ) diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index df780456d6..b355eea693 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -91,6 +91,10 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, EDA_DRAW_FRAME( aKiway, aParent, aWindowType, aTitle, aPosition, aSize, aStyle, aFrameName ) { + printf("calling createCanvas\n"); + createCanvas(); + printf("Canvas %p\n", m_canvas); + m_zoomLevelCoeff = 11.0; // Adjusted to roughly displays zoom level = 1 // when the screen shows a 1:1 image // obviously depends on the monitor, @@ -100,12 +104,48 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, } - SCH_BASE_FRAME::~SCH_BASE_FRAME() { } +void SCH_BASE_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent ) +{ + wxMenuBar* menuBar = GetMenuBar(); + EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas(); + EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = gal_canvas->GetBackend(); + + struct { int menuId; int galType; } menuList[] = + { + { ID_MENU_CANVAS_OPENGL, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL }, + { ID_MENU_CANVAS_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO }, + }; + + for( auto ii: menuList ) + { + wxMenuItem* item = menuBar->FindItem( ii.menuId ); + if( ii.galType == canvasType ) + { + item->Check( true ); + } + } +} + + +void SCH_BASE_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent ) +{ + auto new_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; + + if( aEvent.GetId() == ID_MENU_CANVAS_CAIRO ) + new_type = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; + + if( m_canvasType == new_type ) + return; + + GetGalCanvas()->SwitchBackend( new_type ); +} + + void SCH_BASE_FRAME::OnOpenLibraryViewer( wxCommandEvent& event ) { LIB_VIEW_FRAME* viewlibFrame = (LIB_VIEW_FRAME*) Kiway().Player( FRAME_SCH_VIEWER, true ); @@ -554,11 +594,17 @@ bool SCH_BASE_FRAME::HandleBlockBegin( wxDC* aDC, EDA_KEY aKey, const wxPoint& a return true; } - -void EDA_DRAW_FRAME::createCanvas() +void SCH_BASE_FRAME::createCanvas() { + EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = LoadCanvasTypeSetting(); + + // Allows only a CAIRO or OPENGL canvas: + if( canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL && + canvasType != EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ) + canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL; + m_canvas = new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize, - m_galDisplayOptions, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL ); + GetGalDisplayOptions(), canvasType ); m_useSingleCanvasPane = true; diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index fca8e70948..ceba7b5efc 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -102,11 +102,23 @@ public: virtual ~SCH_BASE_FRAME(); + void createCanvas(); + SCH_DRAW_PANEL* GetCanvas() const override; SCH_SCREEN* GetScreen() const override; KIGFX::SCH_RENDER_SETTINGS* GetRenderSettings(); + /** + * switches currently used canvas ( Cairo / OpenGL). + */ + void OnSwitchCanvas( wxCommandEvent& aEvent ); + + /** + * Update UI called when switches currently used canvas (Cairo / OpenGL). + */ + void OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent ); + /** * @return the increment value of the position of an item * for the repeat command diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index 348f54ca25..4aa36700e2 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -60,6 +60,9 @@ BEGIN_EVENT_TABLE( SCH_DRAW_PANEL, wxScrolledWindow ) // EVT_MENU_RANGE( ID_PAN_UP, ID_PAN_RIGHT, EDA_DRAW_PANEL::OnPan ) END_EVENT_TABLE() +// define our user unit value for GAL ( given in GAL unit = 2.54/(IU per meter)) +// TODO: move in a header common to sch_preview_panel.cpp +#define IU_2_GAL_WORLD_UNIT 2.54/(IU_PER_MM*1000) SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition, const wxSize& aSize, @@ -74,16 +77,15 @@ SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, m_defaultCursor = m_currentCursor = wxCURSOR_ARROW; m_showCrossHair = true; #endif - m_view = new KIGFX::SCH_VIEW( true ); m_view->SetGAL( m_gal ); - m_gal->SetWorldUnitLength( 0.01 ); // 1 unit = 0.01 inch + m_gal->SetWorldUnitLength( IU_2_GAL_WORLD_UNIT ); m_painter.reset( new KIGFX::SCH_PAINTER( m_gal ) ); m_view->SetPainter( m_painter.get() ); - m_view->SetScaleLimits( 2000000.0, 0.002 ); + m_view->SetScaleLimits( 2000.0, 0.002 ); m_view->SetMirror( false, false ); setDefaultLayerOrder(); @@ -134,7 +136,7 @@ SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, m_doubleClickInterval = 250; - m_gal->SetGridColor( COLOR4D(0.0, 0.0, 0.0, 1.0) ); + m_gal->SetGridColor( GetLayerColor( LAYER_SCHEMATIC_GRID ) ); m_gal->SetCursorColor( COLOR4D(0.0, 0.0, 0.0, 1.0) ); m_viewControls->SetSnapping( true ); @@ -195,8 +197,12 @@ void SCH_DRAW_PANEL::setDefaultLayerOrder() bool SCH_DRAW_PANEL::SwitchBackend( GAL_TYPE aGalType ) { + VECTOR2D grid_size = m_gal->GetGridSize(); bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType ); setDefaultLayerDeps(); + m_gal->SetWorldUnitLength( IU_2_GAL_WORLD_UNIT ); + m_gal->SetGridSize( grid_size ); + m_gal->SetGridColor( GetLayerColor( LAYER_SCHEMATIC_GRID ) ); return rv; } @@ -375,6 +381,7 @@ void SCH_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) if( event.MiddleIsDown() ) { +/* Not used in GAL canvas wxPoint currentPosition = event.GetPosition(); double scale = GetParent()->GetScreen()->GetScalingFactor(); @@ -384,6 +391,8 @@ void SCH_DRAW_PANEL::OnMouseEvent( wxMouseEvent& event ) KiROUND( (double) ( m_PanStartEventPosition.y - currentPosition.y ) / scale ); GetParent()->RedrawScreen( wxPoint( x, y ), false ); +*/ + return; } // Calling the general function on mouse changes (and pseudo key commands) @@ -679,7 +688,6 @@ void SCH_DRAW_PANEL::onPaint( wxPaintEvent& aEvent ) { if( m_painter ) static_cast(m_painter.get())->GetSettings()->ImportLegacyColors( nullptr ); - + EDA_DRAW_PANEL_GAL::onPaint( aEvent ); } - \ No newline at end of file diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 0fe499a618..168662387f 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -323,6 +323,9 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) SCH_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_POPUP_SCH_DISPLAYDOC_CMP, SCH_EDIT_FRAME::OnEditItem ) + EVT_MENU( ID_MENU_CANVAS_CAIRO, SCH_EDIT_FRAME::OnSwitchCanvas ) + EVT_MENU( ID_MENU_CANVAS_OPENGL, SCH_EDIT_FRAME::OnSwitchCanvas ) + // Tools and buttons options toolbar EVT_TOOL( ID_TB_OPTIONS_HIDDEN_PINS, SCH_EDIT_FRAME::OnSelectOptionToolbar ) EVT_TOOL( ID_TB_OPTIONS_BUS_WIRES_ORIENT, SCH_EDIT_FRAME::OnSelectOptionToolbar ) @@ -350,6 +353,8 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_UPDATE_UI( ID_UPDATE_ONE_SHEET, SCH_EDIT_FRAME::OnUpdateSaveSheet ) EVT_UPDATE_UI( ID_POPUP_SCH_LEAVE_SHEET, SCH_EDIT_FRAME::OnUpdateHierarchySheet ) EVT_UPDATE_UI( ID_REMAP_SYMBOLS, SCH_EDIT_FRAME::OnUpdateRemapSymbols ) + EVT_UPDATE_UI( ID_MENU_CANVAS_CAIRO, SCH_EDIT_FRAME::OnUpdateSwitchCanvas ) + EVT_UPDATE_UI( ID_MENU_CANVAS_OPENGL, SCH_EDIT_FRAME::OnUpdateSwitchCanvas ) /* Search dialog events. */ EVT_FIND_CLOSE( wxID_ANY, SCH_EDIT_FRAME::OnFindDialogClose ) diff --git a/eeschema/sch_preview_panel.cpp b/eeschema/sch_preview_panel.cpp index 3d71629380..0d9b46b796 100644 --- a/eeschema/sch_preview_panel.cpp +++ b/eeschema/sch_preview_panel.cpp @@ -40,6 +40,9 @@ using namespace std::placeholders; +// define our user unit value for GAL ( given in GAL unit = 2.54/(IU per meter)) +// TODO: move in a header common to sch_draw_panel.cpp +#define IU_2_GAL_WORLD_UNIT 2.54/(IU_PER_MM*1000) SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition, const wxSize& aSize, @@ -50,12 +53,12 @@ SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL( wxWindow* aParentWindow, wxWindowID aWindo m_view = new KIGFX::SCH_VIEW( true ); m_view->SetGAL( m_gal ); - m_gal->SetWorldUnitLength( 0.01 ); // 1 unit = 0.01 inch + m_gal->SetWorldUnitLength( IU_2_GAL_WORLD_UNIT ); m_painter.reset( new KIGFX::SCH_PAINTER( m_gal ) ); m_view->SetPainter( m_painter.get() ); - m_view->SetScaleLimits( 2000000.0, 0.002 ); + m_view->SetScaleLimits( 20000.0, 0.002 ); m_view->SetMirror( false, false ); setDefaultLayerOrder(); @@ -139,4 +142,3 @@ void SCH_PREVIEW_PANEL::onPaint( wxPaintEvent& aEvent ) if( IsShown() ) EDA_DRAW_PANEL_GAL::onPaint( aEvent ); } - \ No newline at end of file diff --git a/include/class_draw_panel_gal.h b/include/class_draw_panel_gal.h index 2626c4bc78..ded6c7499d 100644 --- a/include/class_draw_panel_gal.h +++ b/include/class_draw_panel_gal.h @@ -162,7 +162,7 @@ public: virtual void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector& aList ) { - assert( false ); + wxASSERT( false ); } /** @@ -210,7 +210,7 @@ public: * Set the current cursor shape for this panel */ virtual void SetCurrentCursor( int aCursor ); - + /** * Function GetDefaultCursor * @return the default cursor shape diff --git a/include/draw_frame.h b/include/draw_frame.h index 6657e3c70b..c9948761ec 100644 --- a/include/draw_frame.h +++ b/include/draw_frame.h @@ -78,10 +78,9 @@ class EDA_DRAW_FRAME : public KIWAY_PLAYER ///< GAL display options - this is the frame's interface to setting GAL display options KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions; - bool m_useSingleCanvasPane; - protected: + bool m_useSingleCanvasPane; wxSocketServer* m_socketServer; std::vector m_sockets; ///< interprocess communication @@ -218,8 +217,6 @@ protected: ///> Key in KifaceSettings to store the canvas type. static const wxChar CANVAS_TYPE_KEY[]; - void createCanvas(); - public: EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index b492522031..557dac11b0 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -416,6 +416,7 @@ bool PCB_DRAW_PANEL_GAL::SwitchBackend( GAL_TYPE aGalType ) { bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType ); setDefaultLayerDeps(); + m_gal->SetWorldUnitLength( 2.54/(IU_PER_MM*1000) ); // world unit is in internal units per inch * 1000 return rv; }