Eeschema: Add options for selection appearance

ADDED: Three new options that affects selection appearance:
- Draw selected text items as box
- Draw selected child items
- Fill selected shapes
This commit is contained in:
Jonatan Liljedahl 2019-11-21 16:48:44 +01:00 committed by Seth Hillbrand
parent a5f8340654
commit e517069a51
8 changed files with 406 additions and 31 deletions

View File

@ -78,6 +78,10 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow()
m_checkPageLimits->SetValue( m_frame->ShowPageLimits() );
m_checkSelTextBox->SetValue( GetSelectionTextAsBox() );
m_checkSelDrawChildItems->SetValue( GetSelectionDrawChildItems() );
m_checkSelFillShapes->SetValue( GetSelectionFillShapes() );
m_galOptsPanel->TransferDataToWindow();
return true;
@ -113,6 +117,9 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
SCH_JUNCTION::SetSymbolSize( m_junctionSize.GetValue() );
m_frame->SetShowAllPins( m_checkShowHiddenPins->GetValue() );
m_frame->SetShowPageLimits( m_checkPageLimits->GetValue() );
SetSelectionTextAsBox( m_checkSelTextBox->GetValue() );
SetSelectionDrawChildItems( m_checkSelDrawChildItems->GetValue() );
SetSelectionFillShapes( m_checkSelFillShapes->GetValue() );
// Update canvas
m_frame->GetRenderSettings()->m_ShowHiddenPins = m_checkShowHiddenPins->GetValue();

View File

@ -68,10 +68,10 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
sbSizer2->Add( fgSizer32, 0, wxBOTTOM|wxRIGHT|wxEXPAND, 5 );
bRightColumn->Add( sbSizer2, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
bRightColumn->Add( sbSizer2, 0, wxEXPAND|wxTOP, 5 );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Annotations") ), wxVERTICAL );
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Appearance") ), wxVERTICAL );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
@ -96,14 +96,29 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
sbSizer1->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxALL, 5 );
m_checkSuperSub = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Enable superscript/subscript markup"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkSuperSub, 0, wxALL, 5 );
sbSizer1->Add( m_checkSuperSub, 0, wxALL|wxEXPAND, 5 );
m_checkPageLimits = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkPageLimits->SetValue(true);
sbSizer1->Add( m_checkPageLimits, 0, wxEXPAND|wxALL, 5 );
bRightColumn->Add( sbSizer1, 1, wxEXPAND|wxTOP|wxRIGHT, 5 );
bRightColumn->Add( sbSizer1, 1, wxEXPAND|wxTOP, 5 );
wxStaticBoxSizer* sbSizer3;
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Selection") ), wxVERTICAL );
m_checkSelTextBox = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Draw selected text items as box"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer3->Add( m_checkSelTextBox, 0, wxALL|wxEXPAND, 5 );
m_checkSelDrawChildItems = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Draw selected child items"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer3->Add( m_checkSelDrawChildItems, 0, wxALL|wxEXPAND, 5 );
m_checkSelFillShapes = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Fill selected shapes"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer3->Add( m_checkSelFillShapes, 0, wxALL|wxEXPAND, 5 );
bRightColumn->Add( sbSizer3, 1, wxEXPAND|wxTOP, 5 );
bPanelSizer->Add( bRightColumn, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );

View File

@ -76,7 +76,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
@ -666,11 +666,11 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Annotations</property>
<property name="label">Appearance</property>
<property name="minimum_size"></property>
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
@ -680,7 +680,7 @@
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer6</property>
<property name="orient">wxHORIZONTAL</property>
@ -888,7 +888,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
@ -1016,6 +1016,212 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Selection</property>
<property name="minimum_size"></property>
<property name="name">sbSizer3</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Draw selected text items as box</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkSelTextBox</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Draw selected child items</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkSelDrawChildItems</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Fill selected shapes</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkSelFillShapes</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>

View File

@ -48,6 +48,9 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public wxPanel
wxCheckBox* m_checkShowHiddenPins;
wxCheckBox* m_checkSuperSub;
wxCheckBox* m_checkPageLimits;
wxCheckBox* m_checkSelTextBox;
wxCheckBox* m_checkSelDrawChildItems;
wxCheckBox* m_checkSelFillShapes;
public:

View File

@ -52,6 +52,9 @@ static int s_defaultWireThickness = DEFAULTDRAWLINETHICKNESS;
static int s_defaultTextSize = DEFAULT_SIZE_TEXT;
static int s_drawDefaultLineThickness = -1;
static int s_textMarkupFlags = 0;
static bool s_selectTextAsBox = false;
static bool s_selectDrawChildren = true;
static bool s_selectFillShapes = false;
int GetDefaultBusThickness()
@ -114,6 +117,42 @@ void SetDefaultLineThickness( int aThickness )
}
bool GetSelectionTextAsBox()
{
return s_selectTextAsBox;
}
void SetSelectionTextAsBox( bool aBool )
{
s_selectTextAsBox = aBool;
}
bool GetSelectionDrawChildItems()
{
return s_selectDrawChildren;
}
void SetSelectionDrawChildItems( bool aBool )
{
s_selectDrawChildren = aBool;
}
bool GetSelectionFillShapes()
{
return s_selectFillShapes;
}
void SetSelectionFillShapes( bool aBool )
{
s_selectFillShapes = aBool;
}
// Color to draw selected items
COLOR4D GetItemSelectedColor()
{
@ -284,6 +323,10 @@ static const wxChar repeatLibStepXEntry[] = wxT( "LibeditRepeatStepX" );
static const wxChar repeatLibStepYEntry[] = wxT( "LibeditRepeatStepY" );
static const wxChar showPinElectricalType[] = wxT( "LibeditShowPinElectricalType" );
static const wxChar boxedSelectedText[] = wxT( "SelectionTextAsBox" );
static const wxChar drawSelectedChildren[] = wxT( "SelectionDrawChildItems" );
static const wxChar selectionFillShapes[] = wxT( "SelectionFillShapes" );
///@}
PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings()
@ -342,6 +385,10 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
SetDefaultWireThickness( (int) tmp );
SetSelectionTextAsBox( aCfg->ReadBool( boxedSelectedText, false ) );
SetSelectionDrawChildItems( aCfg->ReadBool( drawSelectedChildren, true ) );
SetSelectionFillShapes( aCfg->ReadBool( selectionFillShapes, false ) );
SetTextMarkupFlags( (int) aCfg->Read( TextMarkupFlagsEntry, 0L ) );
if( aCfg->Read( DefaultJctSizeEntry, &tmp ) )
@ -372,8 +419,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
}
}
auto painter = static_cast<KIGFX::SCH_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
KIGFX::SCH_RENDER_SETTINGS* settings = painter->GetSettings();
KIGFX::SCH_RENDER_SETTINGS* settings = GetRenderSettings();
settings->m_ShowPinsElectricalType = false;
settings->m_ShowHiddenText = false;
settings->m_ShowHiddenPins = m_showAllPins;
@ -398,6 +444,9 @@ void SCH_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
aCfg->Write( AutoplaceJustifyEntry, m_autoplaceJustify );
aCfg->Write( AutoplaceAlignEntry, m_autoplaceAlign );
aCfg->Write( FootprintPreviewEntry, m_footprintPreview );
aCfg->Write( boxedSelectedText, GetSelectionTextAsBox() );
aCfg->Write( drawSelectedChildren, GetSelectionDrawChildItems() );
aCfg->Write( selectionFillShapes, GetSelectionFillShapes() );
// Save template fieldnames
STRING_FORMATTER sf;

View File

@ -120,6 +120,25 @@ void SetDefaultBusThickness( int aThickness );
int GetDefaultWireThickness();
void SetDefaultWireThickness( int aThickness );
/**
* Draw selected text items as box
*/
bool GetSelectionTextAsBox();
void SetSelectionTextAsBox( bool aBool );
/**
* Draw selected child items or not
*/
bool GetSelectionDrawChildItems();
void SetSelectionDrawChildItems( bool aBool );
/**
* Draw selected shapes as filled or not
*/
bool GetSelectionFillShapes();
void SetSelectionFillShapes( bool aBool );
int GetTextMarkupFlags();
void SetTextMarkupFlags( int aMarkupFlags );

View File

@ -374,6 +374,7 @@ bool SCH_PAINTER::setDeviceColors( const LIB_ITEM* aItem, int aLayer )
m_gal->SetIsStroke( true );
m_gal->SetLineWidth( getLineWidth( aItem, true ) );
m_gal->SetStrokeColor( getRenderColor( aItem, LAYER_DEVICE, true ) );
m_gal->SetFillColor( getRenderColor( aItem, LAYER_DEVICE, true ) );
return true;
}
@ -411,14 +412,23 @@ bool SCH_PAINTER::setDeviceColors( const LIB_ITEM* aItem, int aLayer )
}
void SCH_PAINTER::fillIfSelection( int aLayer )
{
if( aLayer == LAYER_SELECTION_SHADOWS && GetSelectionFillShapes() )
m_gal->SetIsFill( true );
}
void SCH_PAINTER::draw( LIB_RECTANGLE *aRect, int aLayer )
{
if( !isUnitAndConversionShown( aRect ) )
return;
if( setDeviceColors( aRect, aLayer ) )
{
fillIfSelection( aLayer );
m_gal->DrawRectangle( mapCoords( aRect->GetPosition() ), mapCoords( aRect->GetEnd() ) );
}
}
@ -428,7 +438,10 @@ void SCH_PAINTER::draw( LIB_CIRCLE *aCircle, int aLayer )
return;
if( setDeviceColors( aCircle, aLayer ) )
{
fillIfSelection( aLayer );
m_gal->DrawCircle( mapCoords( aCircle->GetPosition() ), aCircle->GetRadius() );
}
}
@ -487,6 +500,7 @@ void SCH_PAINTER::draw( LIB_POLYLINE *aLine, int aLayer )
for( auto p : pts )
vtx.push_back( mapCoords( p ) );
fillIfSelection( aLayer );
m_gal->DrawPolygon( vtx );
}
}
@ -533,16 +547,33 @@ void SCH_PAINTER::draw( LIB_FIELD *aField, int aLayer )
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( color );
m_gal->SetGlyphSize( VECTOR2D( aField->GetTextSize() ) );
m_gal->SetFontItalic( aField->IsItalic() );
m_gal->SetHorizontalJustify( aField->GetHorizJustify( ) );
m_gal->SetVerticalJustify( aField->GetVertJustify( ) );
auto pos = mapCoords( aField->GetPosition() );
double orient = aField->GetTextAngleRadians();
strokeText( aField->GetText(), pos, orient );
if( drawingShadows && GetSelectionTextAsBox() )
{
EDA_RECT boundaryBox = aField->GetBoundingBox();
m_gal->SetIsFill( true );
m_gal->SetFillColor( color );
m_gal->SetLineWidth( m_gal->GetLineWidth() * 0.5 );
boundaryBox.RevertYAxis();
m_gal->DrawRectangle(
mapCoords( boundaryBox.GetPosition() ), mapCoords( boundaryBox.GetEnd() ) );
}
else
{
m_gal->SetGlyphSize( VECTOR2D( aField->GetTextSize() ) );
m_gal->SetFontItalic( aField->IsItalic() );
m_gal->SetHorizontalJustify( aField->GetHorizJustify() );
m_gal->SetVerticalJustify( aField->GetVertJustify() );
double orient = aField->GetTextAngleRadians();
strokeText( aField->GetText(), pos, orient );
}
// Draw the umbilical line
if( aField->IsMoving() && m_schSettings.m_ShowUmbilicals )
@ -804,9 +835,13 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer )
if( aPin->HasFlag( IS_DANGLING ) && ( aPin->IsVisible() || aPin->IsPowerConnection() ) )
drawPinDanglingSymbol( pos, drawingShadows );
// Draw the labels
LIB_PART* libEntry = aPin->GetParent();
// Draw the labels
if( drawingShadows && ( libEntry->Type() == LIB_PART_T || libEntry->IsSelected() )
&& !GetSelectionDrawChildItems() )
return;
int textOffset = libEntry->GetPinNameOffset();
float nameLineWidth = getLineWidth( aPin, drawingShadows );
@ -1188,6 +1223,19 @@ void SCH_PAINTER::draw( SCH_TEXT *aText, int aLayer )
if( drawingShadows )
{
if( GetSelectionTextAsBox() )
{
EDA_RECT bBox = aText->GetBoundingBox();
m_gal->SetIsFill( true );
m_gal->SetFillColor( color );
m_gal->SetLineWidth( m_gal->GetLineWidth() * 0.5 );
bBox.RevertYAxis();
m_gal->DrawRectangle( mapCoords( bBox.GetPosition() ), mapCoords( bBox.GetEnd() ) );
return;
}
switch( aText->GetLabelSpinStyle() )
{
case 0:
@ -1344,8 +1392,12 @@ void SCH_PAINTER::draw( SCH_FIELD *aField, int aLayer )
if( aField->IsVoid() )
return;
// Calculate the text orientation according to the component orientation.
SCH_COMPONENT* parentComponent = (SCH_COMPONENT*) aField->GetParent();
if( drawingShadows && parentComponent->IsSelected() && !GetSelectionDrawChildItems() )
return;
// Calculate the text orientation according to the component orientation.
int orient = (int) aField->GetTextAngle();
if( parentComponent->GetTransform().y1 ) // Rotate component 90 degrees.
@ -1369,17 +1421,33 @@ void SCH_PAINTER::draw( SCH_FIELD *aField, int aLayer )
EDA_RECT boundaryBox = aField->GetBoundingBox();
wxPoint textpos = boundaryBox.Centre();
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
m_gal->SetStrokeColor( color );
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );
m_gal->SetGlyphSize( VECTOR2D( aField->GetTextSize() ) );
m_gal->SetFontBold( aField->IsBold() );
m_gal->SetFontItalic( aField->IsItalic() );
m_gal->SetTextMirrored( aField->IsMirrored() );
m_gal->SetLineWidth( getLineWidth( aField, drawingShadows ) );
strokeText( aField->GetFullyQualifiedText(), textpos, orient == TEXT_ANGLE_VERT ? M_PI/2 : 0 );
if( drawingShadows && GetSelectionTextAsBox() )
{
m_gal->SetIsFill( true );
m_gal->SetFillColor( color );
m_gal->SetLineWidth( m_gal->GetLineWidth() * 0.5 );
boundaryBox.RevertYAxis();
m_gal->DrawRectangle(
mapCoords( boundaryBox.GetPosition() ), mapCoords( boundaryBox.GetEnd() ) );
}
else
{
m_gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_CENTER );
m_gal->SetVerticalJustify( GR_TEXT_VJUSTIFY_CENTER );
m_gal->SetIsFill( false );
m_gal->SetGlyphSize( VECTOR2D( aField->GetTextSize() ) );
m_gal->SetFontBold( aField->IsBold() );
m_gal->SetFontItalic( aField->IsItalic() );
m_gal->SetTextMirrored( aField->IsMirrored() );
strokeText( aField->GetFullyQualifiedText(), textpos,
orient == TEXT_ANGLE_VERT ? M_PI / 2 : 0 );
}
// Draw the umbilical line
if( aField->IsMoving() )
@ -1462,6 +1530,9 @@ void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
if( drawingShadows && !aSheet->IsSelected() && !sheetPin.IsSelected() )
continue;
if( drawingShadows && !GetSelectionDrawChildItems() && aSheet->IsSelected() )
break;
int width = aSheet->GetPenSize();
wxPoint initial_pos = sheetPin.GetTextPos();
wxPoint offset_pos = initial_pos;
@ -1505,7 +1576,8 @@ void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
else
{
// Could be modified later, when sheets can have their own fill color
m_gal->SetIsFill( false );
m_gal->SetFillColor( getRenderColor( aSheet, LAYER_SHEET_BACKGROUND, true ) );
m_gal->SetIsFill( aSheet->IsSelected() && GetSelectionFillShapes() );
}
m_gal->DrawRectangle( pos, pos + size );
@ -1529,6 +1601,9 @@ void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
if( drawingShadows )
{
if( !GetSelectionDrawChildItems() )
return;
if( aSheet->IsVerticalOrientation() )
{
pos_sheetname.y += getShadowWidth() / 2;

View File

@ -169,6 +169,7 @@ private:
float getTextThickness( const SCH_TEXT* aItem, bool aDrawingShadows );
bool setDeviceColors( const LIB_ITEM* aItem, int aLayer );
void fillIfSelection( int aLayer );
void triLine ( const VECTOR2D &a, const VECTOR2D &b, const VECTOR2D &c );
void strokeText( const wxString& aText, const VECTOR2D& aPosition, double aRotationAngle );