From 6d996e31b8395cbbce5d5ee6b1c93bc1a179a7fd Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 1 Jun 2023 12:12:48 +0100 Subject: [PATCH] Don't dim SCH_FIELDs when selecting them. (They were only getting drawn on top of the selection shadow when drawn by their parent symbol because LIB_FIELD was correctly setting the view layers but SCH_FIELD was not.) (cherry picked from commit 2300b0d2a3bbf1bed29d7e3a7180437d3cceaf77) --- eeschema/sch_field.cpp | 15 +++++++++++++++ eeschema/sch_field.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 7111cfea8e..49b3ab3b7c 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -427,6 +427,21 @@ COLOR4D SCH_FIELD::GetFieldColor() const } +void SCH_FIELD::ViewGetLayers( int aLayers[], int& aCount ) const +{ + aCount = 2; + + switch( m_id ) + { + case REFERENCE_FIELD: aLayers[0] = LAYER_REFERENCEPART; break; + case VALUE_FIELD: aLayers[0] = LAYER_VALUEPART; break; + default: aLayers[0] = LAYER_FIELDS; break; + } + + aLayers[1] = LAYER_SELECTION_SHADOWS; +} + + EDA_ANGLE SCH_FIELD::GetDrawRotation() const { // Calculate the text orientation according to the symbol orientation. diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index a4e3106efa..b27f40d2f2 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -144,6 +144,8 @@ public: m_lastResolvedColor = aField->m_lastResolvedColor; } + void ViewGetLayers( int aLayers[], int& aCount ) const override; + /** * Adjusters to allow EDA_TEXT to draw/print/etc. text in absolute coords. */