29 return aDeemph ? 0.5 : 1.0;
39 str << prefix <<
": ";
67 constexpr
double hdpiSizes[] = { 8, 9, 11, 13, 15 };
68 constexpr
double sizes[] = { 10, 12, 14, 16, 18 };
71 double thicknessFactor;
73 double linePitchFactor;
79 height = hdpiSizes[ 2 + aRelativeSize ];
80 thicknessFactor = 0.15;
82 linePitchFactor = 1.7;
86 height = sizes[ 2 + aRelativeSize ];
87 thicknessFactor = 0.20;
89 linePitchFactor = 1.9;
95 glyphSize = glyphSize * ( height / glyphSize.
y );
102 textDims.
LinePitch = glyphSize.
y * linePitchFactor;
119 const std::vector<wxString>& aStrings,
120 bool aDrawingDropShadows )
135 if( aTextQuadrant.
y > 0 )
137 textPos.
y -= textDims.
LinePitch * ( aStrings.size() + 1 );
140 if( aTextQuadrant.
x < 0 )
149 if( aDrawingDropShadows )
161 if( aDrawingDropShadows )
170 if( aDrawingDropShadows )
177 for(
const wxString& str : aStrings )
float GetLineWidth() const
Get the line width.
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Implementation of conversion functions that require both schematic and board internal units.
TEXT_DIMS SetConstantGlyphHeight(KIGFX::GAL *aGal, int aRelativeSize=0)
Set the GAL glyph height to a constant scaled value, so that it always looks the same on screen.
bool IsFlippedX() const
Return true if flip flag for the X axis is set.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxGLCanvas wrapper for HiDPI/Retina support.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
double GetScaleFactor() const
Get the current scale factor.
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, EDA_DATA_TYPE aType)
Get the units string for a given units type.
wxString DimensionLabel(const wxString &prefix, double aVal, EDA_UNITS aUnits, bool aIncludeUnits=true)
Get a formatted string showing a dimension to a sane precision with an optional prefix and unit suffi...
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
const VECTOR2D & GetGlyphSize() const
COLOR4D GetShadowColor(COLOR4D aColor)
const COLOR4D & GetStrokeColor() const
Get the stroke color.
Auxiliary items (guides, rule, etc)
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void StrokeText(const wxString &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a vector type text using preloaded Newstroke font.
void SetTextMirrored(const bool aMirrored)
Set a mirrored property of text.
double PreviewOverlayDeemphAlpha(bool aDeemph=true)
Default alpha of "de-emphasised" features (like previously locked-in lines.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
void SetGlyphSize(const VECTOR2D aSize)
Set the font glyph size.
double To_User_Unit(EDA_UNITS aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
void SetHorizontalJustify(const EDA_TEXT_HJUSTIFY_T aHorizontalJustify)
Set the horizontal justify for text drawing.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
double GetWorldScale() const
Get the world scale.
void DrawTextNextToCursor(KIGFX::VIEW *aView, const VECTOR2D &aCursorPos, const VECTOR2D &aTextQuadrant, const std::vector< wxString > &aStrings, bool aDrawingDropShadows)
Draw strings next to the cursor.
Abstract interface for drawing on a 2D-surface.
A color representation with 4 components: red, green, blue, alpha.