示例#1
0
 public static void TranslateAndApplyShapeContext(
     ShapeContext context,
     CompositionSpriteShape shape,
     bool reverseDirection,
     double trimOffsetDegrees)
 {
     shape.FillBrush = Brushes.TranslateShapeFill(context, context.Fill, context.Opacity);
     Brushes.TranslateAndApplyStroke(context, context.Stroke, shape, context.Opacity);
     TranslateAndApplyTrimPath(
         context,
         shape.Geometry,
         reverseDirection,
         trimOffsetDegrees);
 }
示例#2
0
        public static void TranslateAndApplyShapeContextWithTrimOffset(
            ShapeContext context,
            CompositionSpriteShape shape,
            bool reverseDirection,
            double trimOffsetDegrees)
        {
            Debug.Assert(shape.Geometry != null, "Precondition");

            shape.FillBrush = Brushes.TranslateShapeFill(context, context.Fill, context.Opacity);
            Brushes.TranslateAndApplyStroke(context, context.Stroke, shape, context.Opacity);

            TranslateAndApplyTrimPath(
                context,
                geometry: shape.Geometry !,
                reverseDirection,
                trimOffsetDegrees);
        }
示例#3
0
        public static void TranslateAndApplyShapeContextWithTrimOffset(
            ShapeContext context,
            CompositionSpriteShape shape,
            bool reverseDirection,
            double trimOffsetDegrees)
        {
            Debug.Assert(shape.Geometry is not null, "Precondition");

            shape.FillBrush = Brushes.TranslateShapeFill(context, context.Fill, context.Opacity);

            // OriginOffset is used to adjust cordinates of FillBrush for Rectangle shapes.
            // It is not needed afterwards, so we clean it up to not affect other code.
            context.LayerContext.OriginOffset = null;

            Brushes.TranslateAndApplyStroke(context, context.Stroke, shape, context.Opacity);

            TranslateAndApplyTrimPath(
                context,
                geometry: shape.Geometry !,
                reverseDirection,
                trimOffsetDegrees);
        }