protected virtual void ApplyBoundingRectInternal(ICanvas canvas, Vector2f minPosition, Vector2f maxPosition) { Rectf rect = new Rectf(minPosition, maxPosition); this.shape = rect; this.outline = rect; }
public static void RenderBorderAndArea(ICanvas canvas, IShapef shape, IPathf border, Area.AreaStyle style, Area.AreaStyle nextStyle, float alpha) { // We first fill background. { // We create background fill. ITransform mappingTransform; IMapper mapper; IFill fill = BackgroundStyle.Merge(style != null ? style.Background : null, nextStyle != null ? nextStyle.Background : null, alpha, out mappingTransform, out mapper); if (fill != null) { if (mappingTransform != null) { canvas.TextureTransform = mappingTransform; } // We fill shape canvas.FillShape(fill, shape, mapper); // Must reset. if (mappingTransform != null) { canvas.TextureTransform = null; } } } // Now we add border over it. { ITransform transform; IMapper mapper; Pen pen = BorderStyle.Merge(style != null ? style.Border : null, nextStyle != null ? nextStyle.Border : null, alpha, out transform, out mapper); if (pen != null && pen.Fill != null) { if (transform != null) { canvas.TextureTransform = transform; } canvas.DrawShape(pen, border, mapper); if (transform != null) { canvas.TextureTransform = null; } } } }
/// <summary> /// Shape with fill initialization. /// </summary> /// <param name="fill"></param> /// <param name="mesh"></param> /// <param name="mapper"></param> public IconData([NotNull] IFill fill, [NotNull] IShapef shape, IMapper mapper) { this.fill = fill; this.shape = shape; this.mapper = mapper; }
/// <summary> /// Icon data with pen and mesh. /// </summary> /// <param name="pen"></param> /// <param name="mesh"></param> public IconData([NotNull] IFill fill, [NotNull] IShapef shape) : this(fill, shape, null) { }