From f002382b4a10698e4deb76e166eb259aa9189537 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 23 Feb 2019 08:17:50 -0800 Subject: [PATCH] eeschema: Set modifying transparency on edits While modifying elements in eeschema/libedit, they are overdrawn on the rest of the schematic. This prevents alignment with existing elements as the underlying elements are not visible. We set a slight transparency on elements while being modified to allow the user to view existing elements at the same time. Fixes: lp:1817233 * https://bugs.launchpad.net/kicad/+bug/1817233 --- eeschema/sch_painter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index ededbb5509..977fcbf405 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -300,6 +300,10 @@ bool SCH_PAINTER::setColors( const LIB_ITEM* aItem, int aLayer ) { COLOR4D color = getOverlayColor( aItem, m_schSettings.GetLayerColor( LAYER_DEVICE_BACKGROUND ), true ); + // These actions place the item over others, so allow a modest transparency here + if( aItem->IsMoving() || aItem->IsDragging() || aItem->IsResized() ) + color = color.WithAlpha( 0.75 ); + m_gal->SetIsFill( true ); m_gal->SetFillColor( color ); @@ -310,6 +314,10 @@ bool SCH_PAINTER::setColors( const LIB_ITEM* aItem, int aLayer ) { COLOR4D color = getOverlayColor( aItem, m_schSettings.GetLayerColor( LAYER_DEVICE ), false ); + // These actions place the item over others, so allow a modest transparency here + if( aItem->IsMoving() || aItem->IsDragging() || aItem->IsResized() ) + color = color.WithAlpha( 0.75 ); + m_gal->SetIsStroke( true ); m_gal->SetStrokeColor( color ); m_gal->SetLineWidth( aItem->GetPenSize() );