From 6816ee937aed5b85b603f91bf319a7bbbae5845a Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Wed, 28 Dec 2022 09:59:38 -0500 Subject: [PATCH] Flags: remove unused IS_DRAGGING --- common/tool/selection_conditions.cpp | 2 +- eeschema/bus-wire-junction.cpp | 4 ++-- include/eda_item.h | 6 +++--- include/eda_item_flags.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/tool/selection_conditions.cpp b/common/tool/selection_conditions.cpp index 61e29ad2ec..63d98ea2a9 100644 --- a/common/tool/selection_conditions.cpp +++ b/common/tool/selection_conditions.cpp @@ -46,7 +46,7 @@ bool SELECTION_CONDITIONS::Empty( const SELECTION& aSelection ) bool SELECTION_CONDITIONS::Idle( const SELECTION& aSelection ) { - constexpr int busyMask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_DRAGGING ); + constexpr int busyMask = ( IS_NEW | IS_PASTED | IS_MOVING ); return !aSelection.Front() || ( aSelection.Front()->GetEditFlags() & busyMask ) == 0; } diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index e3a6c77c3d..5ea82ae45b 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -48,7 +48,7 @@ std::vector SCH_EDIT_FRAME::GetSchematicConnections() for( SCH_ITEM* item : GetScreen()->Items() ) { // Avoid items that are changing - if( !( item->GetEditFlags() & ( IS_DRAGGING | IS_MOVING | IS_DELETED ) ) ) + if( !( item->GetEditFlags() & ( IS_MOVING | IS_DELETED ) ) ) { std::vector pts = item->GetConnectionPoints(); retval.insert( retval.end(), pts.begin(), pts.end() ); @@ -102,7 +102,7 @@ bool SCH_EDIT_FRAME::TrimWire( const VECTOR2I& aStart, const VECTOR2I& aEnd ) for( SCH_LINE* line : wires ) { // Don't remove wires that are already deleted or are currently being dragged - if( line->GetEditFlags() & ( STRUCT_DELETED | IS_DRAGGING | IS_MOVING | SKIP_STRUCT ) ) + if( line->GetEditFlags() & ( STRUCT_DELETED | IS_MOVING | SKIP_STRUCT ) ) continue; if( !IsPointOnSegment( line->GetStartPoint(), line->GetEndPoint(), aStart ) || diff --git a/include/eda_item.h b/include/eda_item.h index 254264a6b7..153c0ab944 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -102,7 +102,7 @@ public: inline bool IsModified() const { return m_flags & IS_CHANGED; } inline bool IsNew() const { return m_flags & IS_NEW; } inline bool IsMoving() const { return m_flags & IS_MOVING; } - inline bool IsDragging() const { return m_flags & IS_DRAGGING; } + inline bool IsSelected() const { return m_flags & SELECTED; } inline bool IsEntered() const { return m_flags & ENTERED; } inline bool IsBrightened() const { return m_flags & BRIGHTENED; } @@ -144,8 +144,8 @@ public: EDA_ITEM_FLAGS GetEditFlags() const { - constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_DRAGGING | IS_BROKEN - | IS_CHANGED | STRUCT_DELETED ); + constexpr int mask = + ( IS_NEW | IS_PASTED | IS_MOVING | IS_BROKEN | IS_CHANGED | STRUCT_DELETED ); return m_flags & mask; } diff --git a/include/eda_item_flags.h b/include/eda_item_flags.h index 9eba772260..8b71d4ad00 100644 --- a/include/eda_item_flags.h +++ b/include/eda_item_flags.h @@ -40,7 +40,7 @@ #define IS_MOVING (1 << 3) ///< Item being moved #define IS_NEW (1 << 4) ///< New item, just created #define IS_BROKEN (1 << 5) ///< Is a segment just broken by BreakSegment -#define IS_DRAGGING (1 << 6) ///< Item being dragged + #define IS_DELETED (1 << 7) #define STARTPOINT (1 << 9) ///< When a line is selected, these flags indicate which