Fix issues with Intersheet Ref highlighting and hover actions.
This commit is contained in:
parent
04a3619428
commit
bd1f262a6b
|
@ -411,7 +411,7 @@ void SCH_PAINTER::draw( LIB_PART *aPart, int aLayer, bool aDrawFields, int aUnit
|
||||||
drawnPart = tmpPart.get();
|
drawnPart = tmpPart.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
for( auto& item : drawnPart->GetDrawItems() )
|
for( const LIB_ITEM& item : drawnPart->GetDrawItems() )
|
||||||
{
|
{
|
||||||
if( !aDrawFields && item.Type() == LIB_FIELD_T )
|
if( !aDrawFields && item.Type() == LIB_FIELD_T )
|
||||||
continue;
|
continue;
|
||||||
|
@ -1574,9 +1574,8 @@ void SCH_PAINTER::draw( SCH_GLOBALLABEL *aLabel, int aLayer )
|
||||||
{
|
{
|
||||||
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
|
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
|
||||||
|
|
||||||
if( drawingShadows && !aLabel->IsSelected() )
|
if( !drawingShadows || aLabel->IsSelected() )
|
||||||
return;
|
{
|
||||||
|
|
||||||
COLOR4D color = getRenderColor( aLabel, LAYER_GLOBLABEL, drawingShadows );
|
COLOR4D color = getRenderColor( aLabel, LAYER_GLOBLABEL, drawingShadows );
|
||||||
|
|
||||||
std::vector<wxPoint> pts;
|
std::vector<wxPoint> pts;
|
||||||
|
@ -1584,16 +1583,13 @@ void SCH_PAINTER::draw( SCH_GLOBALLABEL *aLabel, int aLayer )
|
||||||
|
|
||||||
aLabel->CreateGraphicShape( &m_schSettings, pts, aLabel->GetTextPos() );
|
aLabel->CreateGraphicShape( &m_schSettings, pts, aLabel->GetTextPos() );
|
||||||
|
|
||||||
for( auto p : pts )
|
for( const wxPoint& p : pts )
|
||||||
pts2.emplace_back( VECTOR2D( p.x, p.y ) );
|
pts2.emplace_back( VECTOR2D( p.x, p.y ) );
|
||||||
|
|
||||||
// the text is drawn inside the graphic shape.
|
// The text is drawn inside the graphic shape.
|
||||||
// On Cairo the graphic shape is filled by the background
|
// On Cairo the graphic shape is filled by the background before drawing the text.
|
||||||
// before drawing the text ().
|
// However if the text is selected, it is draw twice: first on LAYER_SELECTION_SHADOWS
|
||||||
// However if the text is selected, it is draw twice:
|
// and second on the text layer. The second must not erase the first drawing.
|
||||||
// first, on LAYER_SELECTION_SHADOWS
|
|
||||||
// second, on the text layer.
|
|
||||||
// the second must not erase the first drawing.
|
|
||||||
bool fillBg = ( aLayer == LAYER_SELECTION_SHADOWS ) || !aLabel->IsSelected();
|
bool fillBg = ( aLayer == LAYER_SELECTION_SHADOWS ) || !aLabel->IsSelected();
|
||||||
m_gal->SetIsFill( fillBg );
|
m_gal->SetIsFill( fillBg );
|
||||||
m_gal->SetFillColor( m_schSettings.GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
m_gal->SetFillColor( m_schSettings.GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||||
|
@ -1603,8 +1599,12 @@ void SCH_PAINTER::draw( SCH_GLOBALLABEL *aLabel, int aLayer )
|
||||||
m_gal->DrawPolyline( pts2 );
|
m_gal->DrawPolyline( pts2 );
|
||||||
|
|
||||||
draw( static_cast<SCH_TEXT*>( aLabel ), aLayer );
|
draw( static_cast<SCH_TEXT*>( aLabel ), aLayer );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !drawingShadows || eeconfig()->m_Selection.draw_selected_children || !aLabel->IsSelected() )
|
||||||
|
{
|
||||||
draw( aLabel->GetIntersheetRefs(), aLayer );
|
draw( aLabel->GetIntersheetRefs(), aLayer );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -512,7 +512,8 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
displayWireCursor = true;
|
displayWireCursor = true;
|
||||||
}
|
}
|
||||||
else if( collector[0]->IsHypertext()
|
else if( collector[0]->IsHypertext()
|
||||||
&& ( !m_additive && !m_subtractive && !m_exclusive_or ) )
|
&& !collector[0]->IsSelected()
|
||||||
|
&& !m_additive && !m_subtractive && !m_exclusive_or )
|
||||||
{
|
{
|
||||||
rolloverItem = collector[0]->m_Uuid;
|
rolloverItem = collector[0]->m_Uuid;
|
||||||
}
|
}
|
||||||
|
@ -555,13 +556,19 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
if( m_frame->ToolStackIsEmpty() )
|
if( m_frame->ToolStackIsEmpty() )
|
||||||
{
|
{
|
||||||
if( displayWireCursor )
|
if( displayWireCursor )
|
||||||
|
{
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::LINE_WIRE_ADD );
|
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::LINE_WIRE_ADD );
|
||||||
|
}
|
||||||
else if( rolloverItem != niluuid )
|
else if( rolloverItem != niluuid )
|
||||||
|
{
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::HAND );
|
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::HAND );
|
||||||
|
}
|
||||||
else if( !modifier_enabled && !m_selection.Empty()
|
else if( !modifier_enabled && !m_selection.Empty()
|
||||||
&& !m_frame->GetDragSelects() && evt->HasPosition()
|
&& !m_frame->GetDragSelects() && evt->HasPosition()
|
||||||
&& selectionContains( evt->Position() ) ) //move/drag option prediction
|
&& selectionContains( evt->Position() ) ) //move/drag option prediction
|
||||||
|
{
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
|
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_additive )
|
if( m_additive )
|
||||||
|
@ -660,16 +667,6 @@ bool EE_SELECTION_TOOL::selectPoint( EE_COLLECTOR& aCollector, EDA_ITEM** aItem,
|
||||||
{
|
{
|
||||||
m_selection.ClearReferencePoint();
|
m_selection.ClearReferencePoint();
|
||||||
|
|
||||||
// Unmodified clicking of hypertext items results in hypertext actions rather than selection.
|
|
||||||
if( !aAdd && !aSubtract && !aExclusiveOr )
|
|
||||||
{
|
|
||||||
for( int i = aCollector.GetCount() - 1; i >= 0; --i )
|
|
||||||
{
|
|
||||||
if( aCollector[i]->IsHypertext() )
|
|
||||||
aCollector.Remove( i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If still more than one item we're going to have to ask the user.
|
// If still more than one item we're going to have to ask the user.
|
||||||
if( aCollector.GetCount() > 1 )
|
if( aCollector.GetCount() > 1 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue