Blob Blame History Raw
diff -ru kicad-2010.04.06/pcbnew/class_board.cpp kicad-2010.04.06-new/pcbnew/class_board.cpp
--- kicad-2010.04.06/pcbnew/class_board.cpp	2010-03-01 18:48:17.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_board.cpp	2010-05-01 18:55:48.000000000 +0200
@@ -791,31 +791,16 @@
         }
     }
 
-    /* Analise footprints  */
+    /* Analyze footprints  */
 
     for( MODULE* module = m_Modules; module; module = module->Next() )
     {
         hasItems = TRUE;
-        xmin     = MIN( xmin, ( module->m_Pos.x
-                                + module->m_BoundaryBox.GetX() ) );
-        ymin     = MIN( ymin, ( module->m_Pos.y
-                                + module->m_BoundaryBox.GetY() ) );
-        xmax     = MAX( xmax, module->m_Pos.x
-                        + module->m_BoundaryBox.GetRight() );
-        ymax     = MAX( ymax,
-                        module->m_Pos.y + module->m_BoundaryBox.GetBottom() );
-
-
-        for( D_PAD* pt_pad = module->m_Pads; pt_pad; pt_pad = pt_pad->Next() )
-        {
-            const wxPoint& pos = pt_pad->GetPosition();
-
-            d    = pt_pad->m_Rayon;
-            xmin = MIN( xmin, pos.x - d );
-            ymin = MIN( ymin, pos.y - d );
-            xmax = MAX( xmax, pos.x + d );
-            ymax = MAX( ymax, pos.y + d );
-        }
+        EDA_Rect box = module->GetBoundingBox();
+        xmin     = MIN( xmin, box.GetX() );
+        ymin     = MIN( ymin, box.GetY() );
+        xmax     = MAX( xmax, box.GetRight() );
+        ymax     = MAX( ymax, box.GetBottom() );
     }
 
     /* Analise track and zones */
diff -ru kicad-2010.04.06/pcbnew/class_module.cpp kicad-2010.04.06-new/pcbnew/class_module.cpp
--- kicad-2010.04.06/pcbnew/class_module.cpp	2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/class_module.cpp	2010-05-01 18:57:21.000000000 +0200
@@ -623,11 +623,10 @@
 
 /* Update the bounding rectangle of the module
  *
- * The rectangle is the rectangle with the contours and
- * Pads.
- * The rectangle is calculated:
- * For East 0
- * Coord in on / anchor position
+ * The bounding box includes outlines and pads, but not the fields.
+ * The rectangle is:
+ *      for orientation 0
+ *      coordinates relative to the module anchor.
  */
 void MODULE::Set_Rectangle_Encadrement()
 {
@@ -702,10 +701,9 @@
 }
 
 
-/* Equivalent to Module:: Set_Rectangle_Encadrement() coord but real:
- * Updating the rectangle real module PCB cad in ord
- * Entree: pointer module
- * The rectangle is the rectangle with the contours and pads.
+/* Equivalent to Module::Set_Rectangle_Encadrement() but in board coordinates:
+ * Updates the module bounding box on the board
+ * The rectangle is the rectangle with outlines and pads, but not the fields
  * Also updates the surface (.M_Surface) module.
  */
 void MODULE::SetRectangleExinscrit()
@@ -785,7 +783,7 @@
 
 /**
  * Function GetBoundingBox
- * returns the full bounding box of this Footprint, including texts
+ * returns the full bounding box of this Footprint, including fields
  * Mainly used to redraw the screen area occupied by the footprint
  */
 EDA_Rect MODULE::GetBoundingBox()
Seulement dans kicad-2010.04.06/pcbnew/CMakeFiles/pcbnew.dir/__/common: dialog_page_settings.cpp.o
diff -ru kicad-2010.04.06/pcbnew/moduleframe.cpp kicad-2010.04.06-new/pcbnew/moduleframe.cpp
--- kicad-2010.04.06/pcbnew/moduleframe.cpp	2010-02-22 17:45:35.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/moduleframe.cpp	2010-05-01 19:01:10.000000000 +0200
@@ -288,7 +288,6 @@
     m_HToolBar->EnableTool( ID_MODEDIT_SAVE_LIBMODULE, active && islib );
     MODULE* module_in_edit = GetBoard()->m_Modules;
     if( module_in_edit && module_in_edit->m_Link ) // this is not a new module
-                                                   // ...
     {
         BOARD*  mainpcb = frame->GetBoard();
         MODULE* source_module = mainpcb->m_Modules;
@@ -334,6 +333,7 @@
     {
         m_HToolBar->EnableTool( ID_MODEDIT_LOAD_MODULE_FROM_BOARD, false );
     }
+    m_HToolBar->Refresh();
 
 
     if( m_VToolBar )
@@ -345,6 +345,7 @@
         m_VToolBar->EnableTool( ID_PCB_ADD_TEXT_BUTT, active );
         m_VToolBar->EnableTool( ID_MODEDIT_PLACE_ANCHOR, active );
         m_VToolBar->EnableTool( ID_PCB_DELETE_ITEM_BUTT, active );
+        m_VToolBar->Refresh();
     }
 
     if( m_OptionsToolBar )
@@ -382,6 +383,7 @@
                                             m_DisplayPadFill ?
                                             _( "Show pads in sketch mode" ) :
                                             _( "Show pads in filled mode" ) );
+        m_OptionsToolBar->Refresh();
     }
 
     if( m_AuxiliaryToolBar )
@@ -402,6 +404,8 @@
 
             if( not_found )
                 m_SelZoomBox->SetSelection( -1 );
+
+        m_AuxiliaryToolBar->Refresh();
         }
 
         if( m_SelGridBox )
diff -ru kicad-2010.04.06/pcbnew/toolbars_update_user_interface.cpp kicad-2010.04.06-new/pcbnew/toolbars_update_user_interface.cpp
--- kicad-2010.04.06/pcbnew/toolbars_update_user_interface.cpp	2010-02-08 19:15:42.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/toolbars_update_user_interface.cpp	2010-05-01 19:02:10.000000000 +0200
@@ -141,6 +141,8 @@
         m_SelGridBox->SetSelection( m_LastGridSizeId );
 
     m_TrackAndViasSizesList_Changed = false;
+
+    m_AuxiliaryToolBar->Refresh();
 }
 
 
@@ -181,6 +183,7 @@
 
     state = GetScreen()->GetRedoCommandCount() > 0;
     m_HToolBar->EnableTool( wxID_REDO, state );
+    m_HToolBar->Refresh();
 
     if( m_OptionsToolBar )
     {
@@ -267,6 +270,7 @@
 
         m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
                                       m_auimgr.GetPane(wxT("m_AuxVToolBar")).IsShown() );
+        m_OptionsToolBar->Refresh();
     }
 
     if( m_AuxiliaryToolBar )