diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 54b411e019..1534d77e38 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -108,8 +108,11 @@ void EDA_DRAW_FRAME::Process_PageSettings( wxCommandEvent& event ) if( dlg.ShowModal() == wxID_OK ) { - if( m_canvas ) - m_canvas->Refresh(); +#ifdef EESCHEMA + RedrawScreen( wxPoint( 0, 0 ), false ); +#else + GetCanvas()->Refresh(); +#endif } } @@ -234,7 +237,6 @@ void DIALOG_PAGES_SETTINGS::OnOkClick( wxCommandEvent& event ) if( SavePageSettings() ) { m_screen->SetModify(); - m_parent->GetCanvas()->Refresh(); if( LocalPrjConfigChanged() ) m_parent->SaveProjectSettings( false ); diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index c746439281..e8af80ec6d 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -229,3 +229,10 @@ BITMAP_DEF SCH_BITMAP::GetMenuImage() const { return image_xpm; } + + +void SCH_BITMAP::ViewGetLayers( int aLayers[], int& aCount ) const +{ + aCount = 1; + aLayers[0] = LAYER_WORKSHEET; +} diff --git a/eeschema/sch_bitmap.h b/eeschema/sch_bitmap.h index 9e4452b283..0ccea01821 100644 --- a/eeschema/sch_bitmap.h +++ b/eeschema/sch_bitmap.h @@ -114,7 +114,10 @@ public: void Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, GR_DRAWMODE aDrawMode, COLOR4D aColor = COLOR4D::UNSPECIFIED ) override; - /** + /// @copydoc VIEW_ITEM::ViewGetLayers() + virtual void ViewGetLayers( int aLayers[], int& aCount ) const override; + + /** * Reads and stores an image file. Init the bitmap used to draw this item * format. * diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index 929be3c3cf..1e597ad0cc 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -247,10 +247,19 @@ void SCH_DRAW_PANEL::setDefaultLayerDeps() for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ ) m_view->SetLayerTarget( i, target ); - m_view->SetLayerTarget( LAYER_GP_OVERLAY , KIGFX::TARGET_OVERLAY ); + // Bitmaps are draw on a non cached GAL layer: + m_view->SetLayerTarget( LAYER_DRAW_BITMAPS , KIGFX::TARGET_NONCACHED ); + // Some draw layers need specific settings + m_view->SetLayerTarget( LAYER_GP_OVERLAY , KIGFX::TARGET_OVERLAY ); m_view->SetLayerDisplayOnly( LAYER_GP_OVERLAY ) ; + + m_view->SetLayerTarget( LAYER_SELECT_OVERLAY , KIGFX::TARGET_OVERLAY ); + m_view->SetLayerDisplayOnly( LAYER_SELECT_OVERLAY ) ; + + m_view->SetLayerTarget( LAYER_WORKSHEET , KIGFX::TARGET_NONCACHED ); m_view->SetLayerDisplayOnly( LAYER_WORKSHEET ) ; + m_view->SetLayerDisplayOnly( LAYER_DRC ); } diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index 22733a4719..cc4efaa029 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -197,6 +197,7 @@ enum GAL_LAYER_ID: int LAYER_PCB_BACKGROUND, ///< PCB background color LAYER_CURSOR, ///< PCB cursor LAYER_AUX_ITEMS, ///< Auxiliary items (guides, rule, etc) + LAYER_DRAW_BITMAPS, ///< to handle and draw images bitmaps /// This is the end of the layers used for visibility bitmasks in Pcbnew /// There can be at most 32 layers above here.