コード例 #1
0
        public override void Draw(SKCanvas canvas, RectangleF dirtyRect)
        {
            canvas.Clear(Color.Transparent.ToSKColor());
            if (TypedVirtualView == null || drawMapper == null)
            {
                return;
            }
            canvas.Save();
            var layers  = LayerDrawingOrder();
            var padding = this.GetPadding();
            var rect    = dirtyRect.ApplyPadding(padding);

            foreach (var layer in layers)
            {
                drawMapper.DrawLayer(canvas, rect, this, TypedVirtualView, layer);
            }

            var clipShape = VirtualView?.GetClipShape() ?? VirtualView?.GetBorder();

            if (clipShape != null)
            {
                canvas.ClipPath(clipShape.PathForBounds(rect).ToSKPath());
            }

            drawMapper.DrawLayer(canvas, rect, this, TypedVirtualView, SkiaEnvironmentKeys.Border);

            canvas.Restore();
        }