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); }
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); }
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); }