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);
The lowest level base class of an IGraphics control.
Used to manage a rectangular area, independent of draw class/platform.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
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 SetTooltip(const char *str)
Set a tooltip for the control.
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.
This file contains the base IControl implementation, along with some base classes for specific types ...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
The lowest level base class of an IGraphics context.
virtual void * GetDrawContext()=0
Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implement...
float L
Left side of the rectangle (X)
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
float T
Top of the rectangle (Y)