From de0c051e511ccb814b6f282e8f4553f3ba6c7fb8 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 16 Aug 2013 14:41:09 -0400 Subject: [PATCH] Fix layer alignment target default size. --- pcbnew/mirepcb.cpp | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/pcbnew/mirepcb.cpp b/pcbnew/mirepcb.cpp index ca9101ae9b..d937793e73 100644 --- a/pcbnew/mirepcb.cpp +++ b/pcbnew/mirepcb.cpp @@ -1,6 +1,31 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr + * Copyright (C) 1992-2011 KiCad Developers, see change_log.txt for contributors. + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + /** * @file mirepcb.cpp - * @brief Functions to edit targets (class MIRE). + * @brief Functions to edit targets (class #PCB_TARGET). */ #include @@ -24,16 +49,17 @@ static void ShowTargetShapeWhileMovingMouse( EDA_DRAW_PANEL* aPanel, bool aErase ); // Local variables : -static int MireDefaultSize = 5000; +static int MireDefaultSize = Millimeter2iu( 5 ); + static PCB_TARGET s_TargetCopy( NULL ); /* Used to store "old" values of the * current item parameters before * edition (used in undo/redo or * cancel operations) */ -/************************************/ +/*****************************************/ /* class TARGET_PROPERTIES_DIALOG_EDITOR */ -/************************************/ +/*****************************************/ class TARGET_PROPERTIES_DIALOG_EDITOR : public wxDialog { @@ -192,18 +218,17 @@ static void AbortMoveAndEditTarget( EDA_DRAW_PANEL* Panel, wxDC* DC ) if( ( target->GetFlags() & (IN_EDIT | IS_MOVED) ) ) { target->SetPosition( s_TargetCopy.GetPosition() ); - target->SetWidth( s_TargetCopy.GetWidth() ); - target->SetSize( s_TargetCopy.GetSize() ); - target->SetShape( s_TargetCopy.GetShape() ); + target->SetWidth( s_TargetCopy.GetWidth() ); + target->SetSize( s_TargetCopy.GetSize() ); + target->SetShape( s_TargetCopy.GetShape() ); } + target->ClearFlags(); target->Draw( Panel, DC, GR_OR ); } } -/* Draw Symbol PCB type MIRE. - */ PCB_TARGET* PCB_EDIT_FRAME::CreateTarget( wxDC* DC ) { PCB_TARGET* target = new PCB_TARGET( GetBoard() ); @@ -223,8 +248,6 @@ PCB_TARGET* PCB_EDIT_FRAME::CreateTarget( wxDC* DC ) } -/* Routine to initialize the displacement of a focal - */ void PCB_EDIT_FRAME::BeginMoveTarget( PCB_TARGET* aTarget, wxDC* DC ) { if( aTarget == NULL )