From cd768d83c37dcad23d9ad068dfddce07045b38db Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 22 Jan 2020 09:48:34 -0500 Subject: [PATCH] Eeschema: fix sheet minimum size bug. Convert minimum sheet width and height definitions from mils to internal units. Add comment to sheet minimum width and height definitions to indicate sizes are in mils. --- demos/complex_hierarchy/complex_hierarchy.pro | 18 +++++++++++++++++- eeschema/sch_sheet.cpp | 6 +++--- eeschema/sch_sheet.h | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/demos/complex_hierarchy/complex_hierarchy.pro b/demos/complex_hierarchy/complex_hierarchy.pro index 231d00c289..03f08ab507 100644 --- a/demos/complex_hierarchy/complex_hierarchy.pro +++ b/demos/complex_hierarchy/complex_hierarchy.pro @@ -1,4 +1,4 @@ -update=01/01/2020 17:37:30 +update=Tue 21 Jan 2020 12:19:00 PM EST version=1 last_client=kicad [cvpcb] @@ -254,3 +254,19 @@ uViaDrill=0.2032 dPairWidth=0.4 dPairGap=0.35 dPairViaGap=0.25 +[schematic_editor] +version=1 +PageLayoutDescrFile= +PlotDirectoryName= +SubpartIdSeparator=0 +SubpartFirstId=65 +NetFmtName=Pcbnew +SpiceAjustPassiveValues=0 +LabSize=50 +ERC_WriteFile=0 +ERC_TestSimilarLabels=1 +ERC_CheckUniqueGlobalLabels=1 +ERC_CheckBusDriverConflicts=1 +ERC_CheckBusEntryConflicts=1 +ERC_CheckBusToBusConflicts=1 +ERC_CheckBusToNetConflicts=1 diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index f4458c8f37..42382e7e8d 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -50,7 +50,7 @@ SCH_SHEET::SCH_SHEET( const wxPoint& pos ) : { m_Layer = LAYER_SHEET; m_pos = pos; - m_size = wxSize( MIN_SHEET_WIDTH, MIN_SHEET_HEIGHT ); + m_size = wxSize( Mils2iu( MIN_SHEET_WIDTH ), Mils2iu( MIN_SHEET_HEIGHT ) ); SetTimeStamp( GetNewTimeStamp() ); m_sheetNameSize = GetDefaultTextSize(); m_fileNameSize = GetDefaultTextSize(); @@ -264,7 +264,7 @@ bool SCH_SHEET::HasUndefinedPins() int SCH_SHEET::GetMinWidth() const { - int width = MIN_SHEET_WIDTH; + int width = Mils2iu( MIN_SHEET_WIDTH ); for( size_t i = 0; i < m_pins.size(); i++ ) { @@ -304,7 +304,7 @@ int SCH_SHEET::GetMinWidth() const int SCH_SHEET::GetMinHeight() const { - int height = MIN_SHEET_HEIGHT; + int height = Mils2iu( MIN_SHEET_HEIGHT ); for( size_t i = 0; i < m_pins.size(); i++ ) { diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h index 7d79bcf1d0..f6825dcf70 100644 --- a/eeschema/sch_sheet.h +++ b/eeschema/sch_sheet.h @@ -39,8 +39,8 @@ class SCH_EDIT_FRAME; class NETLIST_OBJECT_LIST; -#define MIN_SHEET_WIDTH 500 -#define MIN_SHEET_HEIGHT 150 +#define MIN_SHEET_WIDTH 500 // Units are mils. +#define MIN_SHEET_HEIGHT 150 // Units are mils. /**