11internal sealed class MenuIndicatorDrawing : DirectDrawingMovableBase
31 private readonly Shape _shape;
34 private SKColor _color;
36 internal MenuIndicatorDrawing(
37 RenderSurfaceHostBase host,
56 internal void SetState(
bool active, SKColor color)
64 protected override void OnDraw(BackbufferBase backbuffer, RectangleF destRectScreen)
69 float size = Math.Min(_theme.IndicatorSize, Math.Min(destRectScreen.Width, destRectScreen.Height));
70 float x = destRectScreen.X + (destRectScreen.Width - size) / 2;
71 float y = destRectScreen.Y + (destRectScreen.Height - size) / 2;
73 using var paint =
new SKPaint
77 StrokeWidth = _theme.IndicatorStrokeWidth,
78 StrokeCap = SKStrokeCap.Round,
79 StrokeJoin = SKStrokeJoin.Round,
80 Style = _shape == Shape.Radio ? SKPaintStyle.Fill : SKPaintStyle.Stroke
83 if (_shape == Shape.Radio)
85 backbuffer.
Canvas.DrawCircle(
94 using var path =
new SKPath();
96 if (_shape == Shape.Check)
98 path.MoveTo(x + size * .15f, y + size * .5f);
99 path.LineTo(x + size * .4f, y + size * .75f);
100 path.LineTo(x + size * .85f, y + size * .2f);
104 path.MoveTo(x + size * .35f, y + size * .2f);
105 path.LineTo(x + size * .65f, y + size * .5f);
106 path.LineTo(x + size * .35f, y + size * .8f);
109 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.