eeschema: More work on selection highlight thickness

Bring back old zoom-level factor scaling constant and
change selection width to absolute unit instead of
floating point multiplier.
This commit is contained in:
Jonatan Liljedahl 2019-12-03 20:47:36 +01:00
parent 681f6bc707
commit 034bfb0919
5 changed files with 14 additions and 15 deletions

View File

@ -127,8 +127,8 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
m_selWidthLabel->Wrap( -1 );
fgSizer321->Add( m_selWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
m_selWidthCtrl = new wxSpinCtrlDouble( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0.5, 50, 0, 0.5 );
m_selWidthCtrl->SetDigits( 1 );
m_selWidthCtrl = new wxSpinCtrlDouble( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 50, 0, 1 );
m_selWidthCtrl->SetDigits( 0 );
fgSizer321->Add( m_selWidthCtrl, 0, wxEXPAND, 5 );

View File

@ -1319,7 +1319,7 @@
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="digits">1</property>
<property name="digits">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
@ -1330,13 +1330,13 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="inc">0.5</property>
<property name="inc">1</property>
<property name="initial">0</property>
<property name="max">50</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">0.5</property>
<property name="min">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>

View File

@ -55,7 +55,7 @@ static int s_textMarkupFlags = 0;
static bool s_selectTextAsBox = false;
static bool s_selectDrawChildren = true;
static bool s_selectFillShapes = false;
static float s_selectThickness = DEFAULTSELECTIONTHICKNESS;
static int s_selectThickness = DEFAULTSELECTIONTHICKNESS;
int GetDefaultBusThickness()
{
@ -153,15 +153,15 @@ void SetSelectionFillShapes( bool aBool )
}
float GetSelectionThickness()
int GetSelectionThickness()
{
return s_selectThickness;
}
void SetSelectionThickness( float aFloat )
void SetSelectionThickness( int aThickness )
{
s_selectThickness = aFloat;
s_selectThickness = aThickness;
}
// Color to draw selected items
@ -401,7 +401,7 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
SetSelectionDrawChildItems( aCfg->ReadBool( drawSelectedChildren, true ) );
SetSelectionFillShapes( aCfg->ReadBool( selectionFillShapes, false ) );
SetSelectionThickness(
(float) aCfg->ReadDouble( selectionThickness, DEFAULTSELECTIONTHICKNESS ) );
static_cast<int>( aCfg->Read( selectionThickness, DEFAULTSELECTIONTHICKNESS ) ) );
SetTextMarkupFlags( (int) aCfg->Read( TextMarkupFlagsEntry, 0L ) );

View File

@ -73,7 +73,7 @@ class SCH_SHEET_PATH;
#define DEFAULTLIBWIDTH 250
///< The default selection highlight thickness
#define DEFAULTSELECTIONTHICKNESS 1.5
#define DEFAULTSELECTIONTHICKNESS 3
/* Rotation, mirror of graphic items in components bodies are handled by a
* transform matrix. The default matrix is useful to draw lib entries with
@ -144,8 +144,8 @@ void SetSelectionFillShapes( bool aBool );
/**
* Selection highlight thickness
*/
float GetSelectionThickness();
void SetSelectionThickness( float aFloat );
int GetSelectionThickness();
void SetSelectionThickness( int aThickness );
int GetTextMarkupFlags();
void SetTextMarkupFlags( int aMarkupFlags );

View File

@ -232,8 +232,7 @@ float SCH_PAINTER::getShadowWidth()
// For best visuals the selection width must be a cross between the zoom level and the
// default line width.
return (float) ( ( fabs( matrix.GetScale().x ) + GetDefaultLineThickness() )
* GetSelectionThickness() );
return static_cast<float>( fabs( matrix.GetScale().x * 2.75 ) + GetSelectionThickness() );
}