From 7e1407f2050edbfe3744839ff57afdb9b0146e51 Mon Sep 17 00:00:00 2001
From: jean-pierre charras <jp.charras@wanadoo.fr>
Date: Mon, 3 Jun 2019 17:39:04 +0200
Subject: [PATCH] Pl_editor: fix incorrect view update after editing a item
 (the view was not refreshed, at least on Windows)

---
 pagelayout_editor/properties_frame.cpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/pagelayout_editor/properties_frame.cpp b/pagelayout_editor/properties_frame.cpp
index 6cb84d595b..d0a7d4852e 100644
--- a/pagelayout_editor/properties_frame.cpp
+++ b/pagelayout_editor/properties_frame.cpp
@@ -29,6 +29,7 @@
 #include <properties_frame.h>
 #include <tool/tool_manager.h>
 #include <tools/pl_selection_tool.h>
+#include <pl_draw_panel_gal.h>
 
 PROPERTIES_FRAME::PROPERTIES_FRAME( PL_EDITOR_FRAME* aParent ):
     PANEL_PROPERTIES_BASE( aParent )
@@ -308,7 +309,12 @@ void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
     CopyPrmsFromGeneralToPanel();
 
     m_parent->OnModify();
-    m_parent->GetGalCanvas()->Refresh();
+
+    // Rebuild the draw list with the new parameters
+    PL_DRAW_PANEL_GAL*  drawPanel = static_cast<PL_DRAW_PANEL_GAL*>( m_parent->GetGalCanvas() );
+    drawPanel->DisplayWorksheet();
+
+    drawPanel->Refresh();
 }
 
 
@@ -321,7 +327,12 @@ void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
     model.m_DefaultTextThickness = 0.15;
 
     CopyPrmsFromGeneralToPanel();
-    m_parent->GetGalCanvas()->Refresh();
+
+    // Rebuild the draw list with the new parameters
+    PL_DRAW_PANEL_GAL*  drawPanel = static_cast<PL_DRAW_PANEL_GAL*>( m_parent->GetGalCanvas() );
+    drawPanel->DisplayWorksheet();
+
+    drawPanel->Refresh();
 }