Fix a couple of problems with text stroke thickness.
This commit is contained in:
parent
da7205ff32
commit
fbd68722b2
|
@ -34,15 +34,12 @@
|
|||
* depending on the application.
|
||||
*/
|
||||
|
||||
#include <base_struct.h>
|
||||
#include <base_units.h>
|
||||
#include <common.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
#include <macros.h>
|
||||
#include <title_block.h>
|
||||
|
||||
#include "libeval/numeric_evaluator.h"
|
||||
|
||||
|
||||
#if defined( PCBNEW ) || defined( CVPCB ) || defined( EESCHEMA ) || defined( GERBVIEW ) || defined( PL_EDITOR )
|
||||
#define IU_TO_MM( x ) ( x / IU_PER_MM )
|
||||
|
|
|
@ -154,7 +154,7 @@ int EDA_TEXT::GetEffectiveTextPenWidth() const
|
|||
}
|
||||
|
||||
// Clip pen size for small texts:
|
||||
width = Clamp_Text_PenSize( width, GetTextSize(), IsBold() );
|
||||
width = Clamp_Text_PenSize( width, GetTextSize(), ALLOW_BOLD_THICKNESS );
|
||||
|
||||
return width;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,15 @@
|
|||
#define INDETERMINATE wxString( "..." )
|
||||
|
||||
|
||||
// PCBNew doesn't support a bold style so we want to allow text thicknesses
|
||||
// that achieve the same effect
|
||||
#if defined( PCBNEW )
|
||||
#define ALLOW_BOLD_THICKNESS true
|
||||
#else
|
||||
#define ALLOW_BOLD_THICKNESS IsBold()
|
||||
#endif
|
||||
|
||||
|
||||
/// Convert mm to mils.
|
||||
inline int Mm2mils( double x ) { return KiROUND( x * 1000./25.4 ); }
|
||||
|
||||
|
@ -139,8 +148,8 @@ wxString MessageTextFromValue( EDA_UNITS aUnits, long long int aValue, bool aUse
|
|||
* @param aUseMils Indicates mils should be used for imperial units (inches).
|
||||
* @return A wxString object containing value and optionally the symbol unit (like 2.000 mm)
|
||||
*/
|
||||
wxString StringFromValue(
|
||||
EDA_UNITS aUnit, double aValue, bool aAddUnitSymbol = false, bool aUseMils = false );
|
||||
wxString StringFromValue( EDA_UNITS aUnit, double aValue, bool aAddUnitSymbol = false,
|
||||
bool aUseMils = false );
|
||||
|
||||
/**
|
||||
* Return in internal units the value "val" given in a real unit
|
||||
|
@ -157,7 +166,8 @@ double From_User_Unit( EDA_UNITS aUnit, double aValue, bool aUseMils = false );
|
|||
* @param aUseMils Indicates mils should be used for imperial units (inches).
|
||||
* @return A double representing that value in internal units
|
||||
*/
|
||||
double DoubleValueFromString( EDA_UNITS aUnits, const wxString& aTextValue, bool aUseMils = false );
|
||||
double DoubleValueFromString( EDA_UNITS aUnits, const wxString& aTextValue,
|
||||
bool aUseMils = false );
|
||||
|
||||
/**
|
||||
* Function ValueFromString
|
||||
|
@ -168,8 +178,8 @@ double DoubleValueFromString( EDA_UNITS aUnits, const wxString& aTextValue, bool
|
|||
* @param aUseMils Indicates mils should be used for imperial units (inches).
|
||||
* @return The string from Value, according to units (inch, mm ...) for display,
|
||||
*/
|
||||
long long int ValueFromString(
|
||||
EDA_UNITS aUnits, const wxString& aTextValue, bool aUseMils = false );
|
||||
long long int ValueFromString( EDA_UNITS aUnits, const wxString& aTextValue,
|
||||
bool aUseMils = false );
|
||||
|
||||
/**
|
||||
* Function FetchUnitsFromString
|
||||
|
|
|
@ -667,6 +667,8 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte )
|
|||
// So we set bold flag to true
|
||||
bool allow_bold = pt_texte->IsBold() || thickness;
|
||||
|
||||
m_plotter->SetCurrentLineWidth( thickness );
|
||||
|
||||
if( pt_texte->IsMultilineAllowed() )
|
||||
{
|
||||
std::vector<wxPoint> positions;
|
||||
|
|
Loading…
Reference in New Issue