From d30af7c164d99d5d4d47a7de3891b874d0c7b009 Mon Sep 17 00:00:00 2001 From: Miklos Marton Date: Sat, 26 Mar 2022 17:27:45 +0100 Subject: [PATCH] eeschema: Add automatic rotate feature for placing global and hierarchial labels --- eeschema/dialogs/dialog_label_properties.cpp | 15 ++ .../dialogs/dialog_label_properties_base.cpp | 6 +- .../dialogs/dialog_label_properties_base.fbp | 82 ++++++- .../dialogs/dialog_label_properties_base.h | 7 +- eeschema/sch_edit_frame.cpp | 30 +++ eeschema/sch_label.cpp | 9 + eeschema/sch_label.h | 29 +++ eeschema/sch_screen.cpp | 217 ++++++++++++++++++ eeschema/sch_screen.h | 4 + eeschema/tools/sch_drawing_tools.cpp | 8 + eeschema/tools/sch_drawing_tools.h | 1 + 11 files changed, 403 insertions(+), 5 deletions(-) diff --git a/eeschema/dialogs/dialog_label_properties.cpp b/eeschema/dialogs/dialog_label_properties.cpp index 3ff6010ab8..07bc9b39a2 100644 --- a/eeschema/dialogs/dialog_label_properties.cpp +++ b/eeschema/dialogs/dialog_label_properties.cpp @@ -310,6 +310,16 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataToWindow() case TEXT_SPIN_STYLE::BOTTOM: m_spin3->Check( true ); break; } + if( m_currentLabel->AutoRotateOnPlacementSupported() ) + { + m_autoRotate->Show(); + m_autoRotate->SetValue( m_currentLabel->AutoRotateOnPlacement() ); + } + else + { + m_autoRotate->Hide(); + } + return true; } @@ -509,6 +519,11 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow() else if( m_spin3->IsChecked() ) selectedSpinStyle = TEXT_SPIN_STYLE::BOTTOM; + if( m_currentLabel->AutoRotateOnPlacementSupported() ) + m_currentLabel->SetAutoRotateOnPlacement( m_autoRotate->IsChecked() ); + else + m_currentLabel->SetAutoRotateOnPlacement( false ); + if( m_currentLabel->GetTextSpinStyle() != selectedSpinStyle ) m_currentLabel->SetTextSpinStyle( selectedSpinStyle ); diff --git a/eeschema/dialogs/dialog_label_properties_base.cpp b/eeschema/dialogs/dialog_label_properties_base.cpp index 652d7c39d6..f4679647f6 100644 --- a/eeschema/dialogs/dialog_label_properties_base.cpp +++ b/eeschema/dialogs/dialog_label_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -82,7 +82,6 @@ DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wx m_grid->SetColSize( 12, 48 ); m_grid->EnableDragColMove( false ); m_grid->EnableDragColSize( true ); - m_grid->SetColLabelSize( 22 ); m_grid->SetColLabelValue( 0, _("Name") ); m_grid->SetColLabelValue( 1, _("Value") ); m_grid->SetColLabelValue( 2, _("Show") ); @@ -231,6 +230,9 @@ DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wx m_spin3 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); formattingSizer->Add( m_spin3, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_autoRotate = new wxCheckBox( formatting->GetStaticBox(), wxID_ANY, _("Auto"), wxDefaultPosition, wxDefaultSize, 0 ); + formattingSizer->Add( m_autoRotate, 0, wxALL, 5 ); + m_separator3 = new BITMAP_BUTTON( formatting->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 21,21 ), wxBU_AUTODRAW|wxBORDER_NONE ); m_separator3->Enable( false ); diff --git a/eeschema/dialogs/dialog_label_properties_base.fbp b/eeschema/dialogs/dialog_label_properties_base.fbp index 2edfca5ffb..b53097e38b 100644 --- a/eeschema/dialogs/dialog_label_properties_base.fbp +++ b/eeschema/dialogs/dialog_label_properties_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_label_properties_base 1000 none + 1 dialog_label_properties_base @@ -25,6 +26,7 @@ 1 1 UI + 0 1 0 @@ -50,6 +52,7 @@ DIALOG_SHIM; dialog_shim.h Label Properties + 0 @@ -529,6 +532,7 @@ + 0 @@ -602,6 +606,7 @@ + 0 @@ -675,6 +680,7 @@ + 0 @@ -758,6 +764,7 @@ + 0 @@ -1604,6 +1611,7 @@ + 0 @@ -1676,6 +1684,7 @@ + 0 @@ -1748,6 +1757,7 @@ + 0 @@ -1820,6 +1830,7 @@ + 0 @@ -1892,6 +1903,7 @@ + 0 @@ -1964,6 +1976,7 @@ + 0 @@ -2036,6 +2049,7 @@ + 0 @@ -2108,6 +2122,7 @@ + 0 @@ -2167,6 +2182,70 @@ + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Auto + + 0 + + + 0 + + 1 + m_autoRotate + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + 5 wxALIGN_CENTER_VERTICAL @@ -2180,6 +2259,7 @@ + 0 diff --git a/eeschema/dialogs/dialog_label_properties_base.h b/eeschema/dialogs/dialog_label_properties_base.h index cb5cf01fd8..ca09a90cf7 100644 --- a/eeschema/dialogs/dialog_label_properties_base.h +++ b/eeschema/dialogs/dialog_label_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 26 2018) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -36,6 +36,7 @@ class WX_GRID; #include #include #include +#include #include #include @@ -85,6 +86,7 @@ class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM BITMAP_BUTTON* m_spin1; BITMAP_BUTTON* m_spin2; BITMAP_BUTTON* m_spin3; + wxCheckBox* m_autoRotate; BITMAP_BUTTON* m_separator3; wxStaticText* m_textSizeLabel; wxTextCtrl* m_textSizeCtrl; @@ -96,7 +98,7 @@ class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - // Virtual event handlers, overide them in your derived class + // Virtual event handlers, override them in your derived class virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void OnValueCharHook( wxKeyEvent& event ) { event.Skip(); } virtual void OnEnterKey( wxCommandEvent& event ) { event.Skip(); } @@ -111,6 +113,7 @@ class DIALOG_LABEL_PROPERTIES_BASE : public DIALOG_SHIM public: DIALOG_LABEL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Label Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_LABEL_PROPERTIES_BASE(); }; diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index a9b2f48e9f..127eea9166 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1349,13 +1349,43 @@ void SCH_EDIT_FRAME::AddItemToScreenAndUndoList( SCH_SCREEN* aScreen, SCH_ITEM* { std::vector pts = aItem->GetConnectionPoints(); + bool connected = true; for( auto i = pts.begin(); i != pts.end(); i++ ) { for( auto j = i + 1; j != pts.end(); j++ ) TrimWire( *i, *j ); if( aScreen->IsExplicitJunctionNeeded( *i ) ) + { AddJunction( aScreen, *i, true, false ); + connected = true; + } + } + + if( connected ) + { + static KICAD_T autoRotatableLabelTypes[] = { SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T }; + if( aItem->IsType( autoRotatableLabelTypes ) ) + { + auto label = static_cast( aItem ); + if( label->AutoRotateOnPlacement() ) + { + auto textSpin = aScreen->GetLabelOrientationForPoint( + label->GetPosition(), label->GetTextSpinStyle(), &GetCurrentSheet() ); + if( textSpin != label->GetTextSpinStyle() ) + { + label->SetTextSpinStyle( textSpin ); + for( SCH_ITEM* item : aScreen->Items().OfType( SCH_GLOBAL_LABEL_T ) ) + { + SCH_LABEL_BASE *otherLabel = static_cast( item ); + if ( otherLabel != label && otherLabel->GetText() == label->GetText() ) + { + otherLabel->AutoplaceFields( aScreen, false ); + } + } + } + } + } } TestDanglingEnds(); diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index 303b9ca380..10cbf13f38 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -885,6 +885,15 @@ void SCH_LABEL_BASE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aO field.Print( aSettings, aOffset ); } +bool SCH_LABEL_BASE::AutoRotateOnPlacement() const +{ + return m_autoRotateOnPlacement; +} + +void SCH_LABEL_BASE::SetAutoRotateOnPlacement( bool autoRotate ) +{ + m_autoRotateOnPlacement = autoRotate; +} SCH_LABEL::SCH_LABEL( const VECTOR2I& pos, const wxString& text ) : SCH_LABEL_BASE( pos, text, SCH_LABEL_T ) diff --git a/eeschema/sch_label.h b/eeschema/sch_label.h index 7b90d3f142..0e08273b54 100644 --- a/eeschema/sch_label.h +++ b/eeschema/sch_label.h @@ -168,6 +168,26 @@ public: void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& offset ) override; + /** + * @brief autoRotateOnPlacement + * @return Returns true if the label rotation will be automatically set on the placement + */ + bool AutoRotateOnPlacement() const; + + /** + * @brief setAutoRotateOnPlacement + * @param autoRotate If set to true when the label is placed in the connection to a + * pin/net the direction will be automatically set according to the positioning of the net/pin + */ + void SetAutoRotateOnPlacement( bool autoRotate = true ); + + /** + * @brief AutoRotateOnPlacementSupported + * @return true if the automated rotation of the label is supported after the placement + * At the moment it is supported for global and hierarchial labels + */ + virtual bool AutoRotateOnPlacementSupported() const = 0; + protected: std::vector m_fields; @@ -175,6 +195,7 @@ protected: CONNECTION_TYPE m_connectionType; bool m_isDangling; + bool m_autoRotateOnPlacement = false; }; @@ -217,6 +238,8 @@ public: return m_isDangling && GetPosition() == aPos; } + bool AutoRotateOnPlacementSupported() const override { return false; } + private: bool doIsConnected( const VECTOR2I& aPosition ) const override { @@ -265,6 +288,8 @@ public: bool IsConnectable() const override { return true; } + bool AutoRotateOnPlacementSupported() const override { return false; } + private: int m_pinLength; int m_symbolSize; @@ -324,6 +349,8 @@ public: return m_isDangling && GetPosition() == aPos; } + bool AutoRotateOnPlacementSupported() const override { return true; } + private: bool doIsConnected( const VECTOR2I& aPosition ) const override { @@ -379,6 +406,8 @@ public: return m_isDangling && GetPosition() == aPos; } + bool AutoRotateOnPlacementSupported() const override { return true; } + private: bool doIsConnected( const VECTOR2I& aPosition ) const override { diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 04048f0729..df083b431f 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -450,6 +450,223 @@ bool SCH_SCREEN::IsExplicitJunctionNeeded( const VECTOR2I& aPosition ) const return isJunction && !hasBusEntry && !hasExplicitJunction; } +TEXT_SPIN_STYLE SCH_SCREEN::GetLabelOrientationForPoint( const VECTOR2I& aPosition, + TEXT_SPIN_STYLE aDefaultOrientation, + const SCH_SHEET_PATH* aSheet ) const +{ + auto ret = aDefaultOrientation; + for( SCH_ITEM* item : Items().Overlapping( aPosition ) ) + { + if( item->GetEditFlags() & STRUCT_DELETED ) + continue; + + switch( item->Type() ) + { + case SCH_BUS_WIRE_ENTRY_T: + { + auto busEntry = static_cast( item ); + if( busEntry->m_connected_bus_item ) + { + // bus connected, take the bus direction into consideration ony if it is + // vertical or horizontal + auto bus = static_cast( busEntry->m_connected_bus_item ); + if( bus->Angle().AsDegrees() == 90.0 ) + { + // bus is vertical -> label shall be horizontal and + // shall be placed to the side where the bus entry is + if( aPosition.x < bus->GetPosition().x ) + ret = TEXT_SPIN_STYLE::LEFT; + else if( aPosition.x > bus->GetPosition().x ) + ret = TEXT_SPIN_STYLE::RIGHT; + } + else if( bus->Angle().AsDegrees() == 0.0 ) + { + // bus is horizontal -> label shall be vertical and + // shall be placed to the side where the bus entry is + if( aPosition.y < bus->GetPosition().y ) + ret = TEXT_SPIN_STYLE::UP; + else if( aPosition.y > bus->GetPosition().y ) + ret = TEXT_SPIN_STYLE::BOTTOM; + } + } + } + break; + + case SCH_LINE_T: + { + auto line = static_cast( item ); + // line angles goes between -90 and 90 degrees, but normalize + auto angle = line->Angle().Normalize90().AsDegrees(); + + if( -45 < angle && angle <= 45 ) + { + if( line->GetStartPoint().x <= line->GetEndPoint().x ) + { + ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::RIGHT + : TEXT_SPIN_STYLE::LEFT; + } + else + { + ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::LEFT + : TEXT_SPIN_STYLE::RIGHT; + } + } + else + { + if( line->GetStartPoint().y <= line->GetEndPoint().y ) + { + ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::BOTTOM + : TEXT_SPIN_STYLE::UP; + } + else + { + ret = line->GetEndPoint() == aPosition ? TEXT_SPIN_STYLE::UP + : TEXT_SPIN_STYLE::BOTTOM; + } + } + } + break; + + case SCH_SYMBOL_T: + { + auto symbol = static_cast( item ); + auto pins = symbol->GetPins( aSheet ); + for( auto pin : pins ) + { + if( pin->GetPosition() == aPosition ) + { + if( pin->GetOrientation() == PIN_RIGHT ) + { + ret = TEXT_SPIN_STYLE::LEFT; + } + else if( pin->GetOrientation() == PIN_LEFT ) + { + ret = TEXT_SPIN_STYLE::RIGHT; + } + else if( pin->GetOrientation() == PIN_UP ) + { + ret = TEXT_SPIN_STYLE::BOTTOM; + } + else if( pin->GetOrientation() == PIN_DOWN ) + { + ret = TEXT_SPIN_STYLE::UP; + } + + switch( static_cast( + symbol->GetOrientation() & ( ~( SYM_MIRROR_X | SYM_MIRROR_Y ) ) ) ) + { + case SYM_ROTATE_CLOCKWISE: + case SYM_ORIENT_90: + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::LEFT; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::BOTTOM; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::UP; + + if( symbol->GetOrientation() & SYM_MIRROR_X ) + { + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::BOTTOM; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::UP; + } + + if( symbol->GetOrientation() & SYM_MIRROR_Y ) + { + if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::LEFT; + } + break; + case SYM_ROTATE_COUNTERCLOCKWISE: + case SYM_ORIENT_270: + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::LEFT; + else if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::UP; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::BOTTOM; + + if( symbol->GetOrientation() & SYM_MIRROR_X ) + { + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::BOTTOM; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::UP; + } + + if( symbol->GetOrientation() & SYM_MIRROR_Y ) + { + if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::LEFT; + } + break; + case SYM_ORIENT_180: + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::BOTTOM; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::UP; + else if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::LEFT; + + if( symbol->GetOrientation() & SYM_MIRROR_X ) + { + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::BOTTOM; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::UP; + } + + if( symbol->GetOrientation() & SYM_MIRROR_Y ) + { + if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::LEFT; + } + break; + case SYM_ORIENT_0: + case SYM_NORMAL: + default: + if( symbol->GetOrientation() & SYM_MIRROR_X ) + { + if( ret == TEXT_SPIN_STYLE::UP ) + ret = TEXT_SPIN_STYLE::BOTTOM; + else if( ret == TEXT_SPIN_STYLE::BOTTOM ) + ret = TEXT_SPIN_STYLE::UP; + } + + if( symbol->GetOrientation() & SYM_MIRROR_Y ) + { + if( ret == TEXT_SPIN_STYLE::LEFT ) + ret = TEXT_SPIN_STYLE::RIGHT; + else if( ret == TEXT_SPIN_STYLE::RIGHT ) + ret = TEXT_SPIN_STYLE::LEFT; + } + break; + } + + break; + } + } + } + break; + default: break; + } + } + return ret; +} + bool SCH_SCREEN::IsExplicitJunctionAllowed( const VECTOR2I& aPosition ) const { diff --git a/eeschema/sch_screen.h b/eeschema/sch_screen.h index 139d30466e..7228168968 100644 --- a/eeschema/sch_screen.h +++ b/eeschema/sch_screen.h @@ -49,6 +49,7 @@ #include #include #include +#include #include class BUS_ALIAS; @@ -335,6 +336,9 @@ public: */ bool IsExplicitJunctionNeeded( const VECTOR2I& aPosition ) const; + TEXT_SPIN_STYLE GetLabelOrientationForPoint( const VECTOR2I& aPosition, + TEXT_SPIN_STYLE aDefaultOrientation, + const SCH_SHEET_PATH* aSheet ) const; /** * Indicates that a juction dot may be placed at the given location. See IsJunctionNeeded * for more info. diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 74324bd3fb..1049361cc0 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -80,6 +80,7 @@ SCH_DRAWING_TOOLS::SCH_DRAWING_TOOLS() : m_inPlaceImage( false ), m_inSingleClickPlace( false ), m_inTwoClickPlace( false ), + m_lastAutoLabelRotateOnPlacement( false ), m_inDrawSheet( false ) { } @@ -934,6 +935,7 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType case LAYER_HIERLABEL: labelItem = new SCH_HIERLABEL( aPosition ); labelItem->SetShape( m_lastGlobalLabelShape ); + labelItem->SetAutoRotateOnPlacement( m_lastAutoLabelRotateOnPlacement ); textItem = labelItem; break; @@ -941,6 +943,7 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType labelItem = new SCH_GLOBALLABEL( aPosition ); labelItem->SetShape( m_lastGlobalLabelShape ); labelItem->GetFields()[0].SetVisible( settings.m_IntersheetRefsShow ); + labelItem->SetAutoRotateOnPlacement( m_lastAutoLabelRotateOnPlacement ); textItem = labelItem; break; @@ -1002,9 +1005,14 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType m_lastTextOrientation = textItem->GetTextSpinStyle(); if( aType == LAYER_GLOBLABEL || aType == LAYER_HIERLABEL ) + { m_lastGlobalLabelShape = labelItem->GetShape(); + m_lastAutoLabelRotateOnPlacement = labelItem->AutoRotateOnPlacement(); + } else if( aType == LAYER_NETCLASS_REFS ) + { m_lastNetClassFlagShape = labelItem->GetShape(); + } return textItem; } diff --git a/eeschema/tools/sch_drawing_tools.h b/eeschema/tools/sch_drawing_tools.h index c668340392..dc96e242af 100644 --- a/eeschema/tools/sch_drawing_tools.h +++ b/eeschema/tools/sch_drawing_tools.h @@ -99,6 +99,7 @@ private: STROKE_PARAMS m_lastStroke; STROKE_PARAMS m_lastTextboxStroke; wxString m_mruPath; + bool m_lastAutoLabelRotateOnPlacement; ///< Re-entrancy guards bool m_inPlaceSymbol;