11internal sealed class MenuIndicatorDrawing : DirectDrawingMovableBase
28 private readonly Shape _shape;
31 private SKColor _color;
33 internal MenuIndicatorDrawing(RenderSurfaceHostBase host,
View view, Rectangle bounds,
41 internal void SetState(
bool active, SKColor color)
49 protected override void OnDraw(BackbufferBase backbuffer, RectangleF destRectScreen)
52 float size = Math.Min(_theme.IndicatorSize, Math.Min(destRectScreen.Width, destRectScreen.Height));
53 float x = destRectScreen.X + (destRectScreen.Width - size) / 2;
54 float y = destRectScreen.Y + (destRectScreen.Height - size) / 2;
55 using var paint =
new SKPaint
59 StrokeWidth = _theme.IndicatorStrokeWidth,
60 StrokeCap = SKStrokeCap.Round,
61 StrokeJoin = SKStrokeJoin.Round,
62 Style = _shape == Shape.Radio ? SKPaintStyle.Fill : SKPaintStyle.Stroke
64 if (_shape == Shape.Radio)
66 backbuffer.
Canvas.DrawCircle(x + size / 2, y + size / 2, size / 4, paint);
69 using var path =
new SKPath();
70 if (_shape == Shape.Check)
72 path.MoveTo(x + size * .15f, y + size * .5f);
73 path.LineTo(x + size * .4f, y + size * .75f);
74 path.LineTo(x + size * .85f, y + size * .2f);
78 path.MoveTo(x + size * .35f, y + size * .2f);
79 path.LineTo(x + size * .65f, y + size * .5f);
80 path.LineTo(x + size * .35f, y + size * .8f);
82 backbuffer.
Canvas.DrawPath(path, paint);
View? View
Gets the view to which this direct drawing is attached, or null if the drawing is in scene-layer mode...
SKCanvas Canvas
Gets the SkiaSharp canvas used for drawing operations on this backbuffer.
DirectDrawingMode
Specifies where direct drawing operations are applied within the rendering pipeline.