]>
Commit | Line | Data |
---|---|---|
1e16fbc7 BS |
1 | commit 51708bab499464d164241ea486c288f653b95320 |
2 | Author: jean-pierre charras <jp.charras@wanadoo.fr> | |
3 | Date: Mon Nov 9 10:32:12 2020 +0100 | |
4 | ||
5 | Gerbview, Legacy graphic mode: fix missing or incorrect inits related to zoom. | |
6 | ||
7 | Fixes #6326 | |
8 | https://gitlab.com/kicad/code/kicad/issues/6326 | |
9 | ||
10 | diff --git a/gerbview/files.cpp b/gerbview/files.cpp | |
11 | index c6b555f36..a10c191f5 100644 | |
12 | --- a/gerbview/files.cpp | |
13 | +++ b/gerbview/files.cpp | |
14 | @@ -57,6 +57,8 @@ void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event ) | |
15 | { | |
16 | Erase_Current_DrawLayer( false ); | |
17 | LoadGerberFiles( fn ); | |
18 | + Zoom_Automatique( false ); | |
19 | + m_canvas->Refresh(); | |
20 | } | |
21 | } | |
22 | ||
23 | @@ -71,6 +73,8 @@ void GERBVIEW_FRAME::OnDrlFileHistory( wxCommandEvent& event ) | |
24 | { | |
25 | Erase_Current_DrawLayer( false ); | |
26 | LoadExcellonFiles( fn ); | |
27 | + Zoom_Automatique( false ); | |
28 | + m_canvas->Refresh(); | |
29 | } | |
30 | } | |
31 | ||
32 | @@ -84,6 +88,8 @@ void GERBVIEW_FRAME::OnZipFileHistory( wxCommandEvent& event ) | |
33 | { | |
34 | Erase_Current_DrawLayer( false ); | |
35 | LoadZipArchiveFile( filename ); | |
36 | + Zoom_Automatique( false ); | |
37 | + m_canvas->Refresh(); | |
38 | } | |
39 | } | |
40 | ||
41 | @@ -93,7 +99,11 @@ void GERBVIEW_FRAME::OnJobFileHistory( wxCommandEvent& event ) | |
42 | wxString filename = GetFileFromHistory( event.GetId(), _( "Job files" ), &m_jobFileHistory ); | |
43 | ||
44 | if( !filename.IsEmpty() ) | |
45 | + { | |
46 | LoadGerberJobFile( filename ); | |
47 | + Zoom_Automatique( false ); | |
48 | + m_canvas->Refresh(); | |
49 | + } | |
50 | } | |
51 | ||
52 | ||
53 | @@ -106,7 +116,9 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event ) | |
54 | { | |
55 | case wxID_FILE: | |
56 | LoadGerberFiles( wxEmptyString ); | |
57 | - break; | |
58 | + Zoom_Automatique( false ); | |
59 | + m_canvas->Refresh(); | |
60 | + break; | |
61 | ||
62 | case ID_GERBVIEW_ERASE_ALL: | |
63 | Clear_DrawLayers( false ); | |
64 | @@ -148,21 +160,26 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event ) | |
65 | // Load the layers from stored paths | |
66 | wxBusyCursor wait; | |
67 | loadListOfGerberAndDrillFiles( wxEmptyString, listOfGerberFiles, &fileType ); | |
68 | + Zoom_Automatique( false ); | |
69 | + m_canvas->Refresh(); | |
70 | } | |
71 | break; | |
72 | ||
73 | case ID_GERBVIEW_LOAD_DRILL_FILE: | |
74 | LoadExcellonFiles( wxEmptyString ); | |
75 | + Zoom_Automatique( false ); | |
76 | m_canvas->Refresh(); | |
77 | break; | |
78 | ||
79 | case ID_GERBVIEW_LOAD_ZIP_ARCHIVE_FILE: | |
80 | LoadZipArchiveFile( wxEmptyString ); | |
81 | + Zoom_Automatique( false ); | |
82 | m_canvas->Refresh(); | |
83 | break; | |
84 | ||
85 | case ID_GERBVIEW_LOAD_JOB_FILE: | |
86 | LoadGerberJobFile( wxEmptyString ); | |
87 | + Zoom_Automatique( false ); | |
88 | m_canvas->Refresh(); | |
89 | break; | |
90 | ||
91 | @@ -373,8 +390,6 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath, | |
92 | ||
93 | SetVisibleLayers( visibility ); | |
94 | ||
95 | - Zoom_Automatique( false ); | |
96 | - | |
97 | // Synchronize layers tools with actual active layer: | |
98 | ReFillLayerWidget(); | |
99 | ||
100 | @@ -700,8 +715,6 @@ bool GERBVIEW_FRAME::LoadZipArchiveFile( const wxString& aFullFileName ) | |
101 | if( filename.IsOk() ) | |
102 | unarchiveFiles( filename.GetFullPath(), &reporter ); | |
103 | ||
104 | - Zoom_Automatique( false ); | |
105 | - | |
106 | // Synchronize layers tools with actual active layer: | |
107 | ReFillLayerWidget(); | |
108 | SetActiveLayer( GetActiveLayer() ); | |
109 | diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp | |
110 | index 6953243e0..890844501 100644 | |
111 | --- a/gerbview/gerbview_frame.cpp | |
112 | +++ b/gerbview/gerbview_frame.cpp | |
113 | @@ -222,6 +222,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): | |
114 | } | |
115 | else | |
116 | { | |
117 | + UseGalCanvas( false ); | |
118 | m_colorsSettings->SetLegacyMode( true ); | |
119 | m_canvas->Refresh(); | |
120 | } |