37#if defined IGRAPHICS_NANOVG
40 nvgTranslate(vg, r1.
MW(), r1.
MH());
41 nvgRotate(vg, nvgDegToRad(30));
42 nvgTranslate(vg, -r1.
MW(), -r1.
MH());
44 nvgRect(vg, r1.L, r1.T, r1.
W(), r1.
H());
45 nvgFillColor(vg, nvgRGBA(255, 0, 0, 255));
48#elif defined IGRAPHICS_SKIA
51 paint.setAntiAlias(
true);
52 paint.setColor(SK_ColorRED);
54 SkRect rect = SkiaRect(r1);
55 canvas->translate(r1.
MW(), r1.
MH());
57 canvas->translate(-r1.
MW(), -r1.
MH());
58 canvas->drawRect(rect, paint);
59#elif defined IGRAPHICS_CANVAS
62 g.
DrawText(mText,
"UNSUPPORTED", mRECT);
This file contains the base IControl implementation, along with some base classes for specific types ...
The lowest level base class of an IGraphics control.
IControl * SetTooltip(const char *str)
Set a tooltip for the control.
The lowest level base class of an IGraphics context.
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
virtual void * GetDrawContext()=0
Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implement...
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
Control to test obtaining a drawing API (NanoVG, Skia, Canvas) context and using that API within an I...
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Used to manage a rectangular area, independent of draw class/platform.
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.