← Back to team overview

kicad-developers team mailing list archive

Re: Redraw issue in modedit and Modview with GAL

 

On 11/01/2013 12:10 PM, jp charras wrote:
Modedit and Modview have a strange behavior when the main canvas is redrawn.
Something is drawn in the upper left corner of the screen (i.e. form the
center of the main canvas to the left corner of the main window client area.

Could be related to the fact the logical origin and therefore the draw
offset to draw items is not the same for the board editor and for
Modview and Modedit:
in board editor, the draw origin is the upper left corner of the page,
and in Modview and Modedit, the draw origin is the center of the page
(because for footprints, the origin of coordinates is usually the center
of the footprint).



The attached patch should solve the problem.

Regards,
Orson
=== modified file 'cvpcb/class_DisplayFootprintsFrame.cpp'
--- cvpcb/class_DisplayFootprintsFrame.cpp	2013-10-31 21:30:57 +0000
+++ cvpcb/class_DisplayFootprintsFrame.cpp	2013-11-01 12:07:02 +0000
@@ -122,8 +122,6 @@
     EDA_PANEINFO mesg;
     mesg.MessageToolbarPane();
 
-    m_galCanvas->Hide();
-
     m_auimgr.AddPane( m_mainToolBar,
                       wxAuiPaneInfo( horiz ).Name( wxT( "m_mainToolBar" ) ).Top(). Row( 0 ) );
 

=== modified file 'pcbnew/basepcbframe.cpp'
--- pcbnew/basepcbframe.cpp	2013-10-30 10:50:09 +0000
+++ pcbnew/basepcbframe.cpp	2013-11-01 12:07:02 +0000
@@ -151,6 +151,8 @@
 
     m_galCanvas           = new EDA_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
                                               EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
+    // Hide by default, it has to be explicitly shown
+    m_galCanvas->Hide();
 
     m_auxiliaryToolBar    = NULL;
 }

Follow ups

References