89 const int markerRad = aView->
ToWorld( 3 );
90 const int markerTextHeight = aView->
ToWorld( 6 );
91 const int markerTextGap = aView->
ToWorld( 3 );
92 const int summaryTextHeight = aView->
ToWorld( 10 );
93 const VECTOR2I textOffset = { markerRad + markerTextGap, 0 };
97 attributes.
m_Size =
VECTOR2I( markerTextHeight, markerTextHeight );
102 std::size_t total = 0;
112 const std::string countStr = std::to_string( count );
113 font.
Draw( &gal, countStr,
anchor + textOffset, attributes, fontMetrics );
120 const int boundaryMargin = aView->
ToWorld( 20 );
122 fontPos +=
VECTOR2I{ boundaryMargin, boundaryMargin };
124 attributes.
m_Size =
VECTOR2I{ summaryTextHeight, summaryTextHeight };
126 wxString totalStr = wxString::Format(
"Current snap anchors: %lu", total );
127 font.
Draw( &gal, totalStr, fontPos, attributes, fontMetrics );
constexpr BOX2I BOX2ISafe(const BOX2D &aInput)
constexpr void SetMaximum()
constexpr coord_type GetLeft() const
constexpr coord_type GetTop() const
A base class for most all the KiCad significant classes used in schematics and boards.
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
void Draw(KIGFX::GAL *aGal, const wxString &aText, const VECTOR2I &aPosition, const VECTOR2I &aCursor, const TEXT_ATTRIBUTES &aAttributes, const METRICS &aFontMetrics) const
Draw a string.
static const METRICS & Default()
View item to draw debug items for anchors.
std::map< VECTOR2I, size_t > m_anchors
ANCHOR_DEBUG * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
void SetNearest(const OPT_VECTOR2I &aNearest)
Set the nearest anchor to the given position.
void AddAnchor(const VECTOR2I &aAnchor)
Add an anchor at the given position.
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
void ViewDraw(int aLayer, VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
A color representation with 4 components: red, green, blue, alpha.
Abstract interface for drawing on a 2D-surface.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
GR_TEXT_H_ALIGN_T m_Halign
@ LAYER_GP_OVERLAY
general purpose overlay
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
The Cairo implementation of the graphics abstraction layer.
std::optional< VECTOR2I > OPT_VECTOR2I
@ NOT_USED
the 3d code uses this value
VECTOR2< int32_t > VECTOR2I