KiCad PCB EDA Suite
|
Small helper class to figure out the layout of text and text-adjacent icons, including text shadows and offsets. More...
Classes | |
struct | LOCATIONS |
Public Member Functions | |
TEXT_AND_ICON_LAYOUT (KIGFX::GAL &aGal, const TEXT_ATTRIBUTES &aAttrs, const KIFONT::METRICS &aFontMetrics, const double aShadowWidth, const double aIconSize=0) | |
Create a new layout helper. | |
LOCATIONS | getTextLayout (const wxString &aText, const VECTOR2I &aPos, GR_TEXT_H_ALIGN_T aIconSide, std::size_t aNIcons, bool aDrawShadow) |
Get the layout of text and icons for a given text string at a position. | |
Private Attributes | |
const TEXT_ATTRIBUTES & | m_attrs |
const KIFONT::METRICS & | m_fontMetrics |
double | m_iconSize |
double | m_iconGap |
double | m_shadowWidth |
double | m_shadowOffset |
Small helper class to figure out the layout of text and text-adjacent icons, including text shadows and offsets.
Definition at line 871 of file sch_painter.cpp.
|
inline |
Create a new layout helper.
Definition at line 878 of file sch_painter.cpp.
References KIGFX::eeconfig(), KIFONT::FONT::GetFont(), and KIFONT::FONT::IsOutline().
|
inline |
Get the layout of text and icons for a given text string at a position.
It will return the position of the text and the icons, as well as the computed shadow text position.
Definition at line 914 of file sch_painter.cpp.
References ANGLE_HORIZONTAL, DIRECTION_45::E, KIGEOM::GetPoint(), KIGFX::GetTextExtents(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, DIRECTION_45::N, DIRECTION_45::S, and DIRECTION_45::W.
Referenced by KIGFX::SCH_PAINTER::draw().
|
private |
Definition at line 968 of file sch_painter.cpp.
|
private |
Definition at line 969 of file sch_painter.cpp.
|
private |
Definition at line 971 of file sch_painter.cpp.
|
private |
Definition at line 970 of file sch_painter.cpp.
|
private |
Definition at line 973 of file sch_painter.cpp.
|
private |
Definition at line 972 of file sch_painter.cpp.