/// <summary> /// Draws a rectangle. /// </summary> /// <param name="rect">The rectangle.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The stroke thickness.</param> public override void DrawRectangle(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) { this.SetAlias(true); var convertedRect = rect.ConvertAliased(); if (fill.IsVisible()) { this.SetFill(fill); using (var path = new CGPath()) { path.AddRect(convertedRect); this.gctx.AddPath(path); } this.gctx.DrawPath(CGPathDrawingMode.Fill); } if (stroke.IsVisible() && thickness > 0) { this.SetStroke(stroke, thickness); using (var path = new CGPath()) { path.AddRect(convertedRect); this.gctx.AddPath(path); } this.gctx.DrawPath(CGPathDrawingMode.Stroke); } }
/// <summary> /// Draws a rectangle. /// </summary> /// <param name="rect">The rectangle.</param> /// <param name="fill">The fill color.</param> /// <param name="stroke">The stroke color.</param> /// <param name="thickness">The stroke thickness.</param> public override void DrawRectangle(OxyRect rect, OxyColor fill, OxyColor stroke, double thickness) { this.SetAlias (true); var convertedRect = rect.ConvertAliased (); if (fill.IsVisible ()) { this.SetFill (fill); using (var path = new CGPath ()) { path.AddRect (convertedRect); this.gctx.AddPath (path); } this.gctx.DrawPath (CGPathDrawingMode.Fill); } if (stroke.IsVisible () && thickness > 0) { this.SetStroke (stroke, thickness); using (var path = new CGPath ()) { path.AddRect (convertedRect); this.gctx.AddPath (path); } this.gctx.DrawPath (CGPathDrawingMode.Stroke); } }