From 254e9f4a7e16dc776f35f86b6264b79d70a23588 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 17 Oct 2018 12:14:09 +0100 Subject: [PATCH] Implement HardRedraw for eeschema and libedit. --- eeschema/libedit/lib_edit_frame.cpp | 9 +++++++++ eeschema/libedit/lib_edit_frame.h | 5 +++++ eeschema/sch_edit_frame.cpp | 7 +++++++ eeschema/sch_edit_frame.h | 5 +++++ 4 files changed, 26 insertions(+) diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index bf3741d63e..ba92fe99f5 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -1720,11 +1720,13 @@ void LIB_EDIT_FRAME::ShowChangedLanguage() UpdateMsgPanel(); } + void LIB_EDIT_FRAME::SetScreen( BASE_SCREEN* aScreen ) { EDA_DRAW_FRAME::SetScreen( aScreen ); } + void LIB_EDIT_FRAME::RebuildView() { KIGFX::SCH_VIEW* view = GetCanvas()->GetView(); @@ -1742,6 +1744,13 @@ void LIB_EDIT_FRAME::RebuildView() GetCanvas()->Refresh(); } + +void LIB_EDIT_FRAME::HardRedraw() +{ + RebuildView(); +} + + const BOX2I LIB_EDIT_FRAME::GetDocumentExtents() const { LIB_PART* part = GetCurPart(); diff --git a/eeschema/libedit/lib_edit_frame.h b/eeschema/libedit/lib_edit_frame.h index 039247a8e3..c428de8e15 100644 --- a/eeschema/libedit/lib_edit_frame.h +++ b/eeschema/libedit/lib_edit_frame.h @@ -715,6 +715,11 @@ public: void RebuildView(); + /** + * Rebuild the GAL and redraw the screen. Call when something went wrong. + */ + void HardRedraw() override; + /** * Checks all draw objects of part to see if they are with block. * diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 338cae5bc6..08a8be1756 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -592,6 +592,13 @@ void SCH_EDIT_FRAME::SetCurrentSheet( const SCH_SHEET_PATH& aSheet ) } +void SCH_EDIT_FRAME::HardRedraw() +{ + static_cast( m_canvas )->DisplaySheet( m_CurrentSheet->LastScreen() ); + GetCanvas()->Refresh(); +} + + void SCH_EDIT_FRAME::SetUndoItem( const SCH_ITEM* aItem ) { // if aItem != NULL, delete a previous m_undoItem, if exists diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 2b02391e32..49ecc7d1cc 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -626,6 +626,11 @@ public: void SetCurrentSheet( const SCH_SHEET_PATH& aSheet ); + /** + * Rebuild the GAL and redraw the screen. Call when something went wrong. + */ + void HardRedraw() override; + /** * Draw the current sheet on the display. */