diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 22218fc239..4a6ef1e9e5 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -182,9 +182,15 @@ bool operator<( const LIB_ALIAS& aItem1, const LIB_ALIAS& aItem2 ) void LIB_ALIAS::ViewGetLayers( int aLayers[], int& aCount ) const { - aCount = 2; + // An alias's fields don't know how to fetch their parent's values so we don't let + // them draw themselves. This means the alias always has to draw them, which means + // it has to "own" their layers as well. + aCount = 5; aLayers[0] = LAYER_DEVICE; aLayers[1] = LAYER_DEVICE_BACKGROUND; + aLayers[2] = LAYER_REFERENCEPART; + aLayers[3] = LAYER_VALUEPART; + aLayers[4] = LAYER_FIELDS; } diff --git a/eeschema/sch_preview_panel.cpp b/eeschema/sch_preview_panel.cpp index 14c8a6ca9d..7bda353644 100644 --- a/eeschema/sch_preview_panel.cpp +++ b/eeschema/sch_preview_panel.cpp @@ -108,8 +108,9 @@ void SCH_PREVIEW_PANEL::setDefaultLayerOrder() void SCH_PREVIEW_PANEL::setDefaultLayerDeps() { - // caching makes no sense for Cairo and other software renderers - auto target = m_backend == GAL_TYPE_OPENGL ? KIGFX::TARGET_CACHED : KIGFX::TARGET_NONCACHED; + // An alias's fields don't know how to substitute in their parent's values, so we + // don't let them draw themselves. This means no caching. + auto target = KIGFX::TARGET_NONCACHED; for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ ) m_view->SetLayerTarget( i, target ); diff --git a/eeschema/sch_view.cpp b/eeschema/sch_view.cpp index ead07bdd86..2e9b8ec5fc 100644 --- a/eeschema/sch_view.cpp +++ b/eeschema/sch_view.cpp @@ -82,18 +82,8 @@ void SCH_VIEW::DisplayComponent( LIB_PART *aPart ) if( !aPart ) return; - int fgPriority = INT_MAX / 2; - int bgPriority = 0; - for ( auto &item : aPart->GetDrawItems() ) - { - // Apply a z-order heuristic (because we don't yet let the user edit it): - // push body-filled objects to the back. - if( item.GetFillMode() == FILLED_WITH_BG_BODYCOLOR ) - Add( &item, bgPriority++ ); - else - Add( &item, fgPriority++ ); - } + Add( &item ); m_selectionArea.reset( new KIGFX::PREVIEW::SELECTION_AREA( ) ); m_preview.reset( new KIGFX::VIEW_GROUP () );