Esempio n. 1
0
        private void Initialize()
        {
            if (Element is not SvgAnchor svgAnchor)
            {
                return;;
            }

            IsAntialias = SvgExtensions.IsAntialias(svgAnchor);

            GeometryBounds = SKRect.Empty;

            CreateGeometryBounds();

            Transform = SvgExtensions.ToMatrix(svgAnchor.Transforms);

            Fill   = null;
            Stroke = null;

            ClipPath     = null;
            MaskDrawable = null;
            Opacity      = IgnoreAttributes.HasFlag(DrawAttributes.Opacity)
                ? null
                : SvgExtensions.GetOpacityPaint(svgAnchor);
            Filter = null;
        }
Esempio n. 2
0
        public override void PostProcess(SKRect?viewport, SKMatrix totalMatrix)
        {
            var element = Element;

            if (element is null)
            {
                return;
            }

            var enableOpacity = !IgnoreAttributes.HasFlag(DrawAttributes.Opacity);

            ClipPath     = null;
            MaskDrawable = null;
            Opacity      = enableOpacity ? SvgExtensions.GetOpacityPaint(element) : null;
            Filter       = null;

            TotalTransform    = totalMatrix.PreConcat(Transform);
            TransformedBounds = TotalTransform.MapRect(GeometryBounds);

            foreach (var child in ChildrenDrawables)
            {
                child.PostProcess(viewport, totalMatrix);
            }
        }