Commit 3c3e5608 authored by Tebjan Halm's avatar Tebjan Halm Committed by GitHub
Browse files

Merge pull request #261 from sovietmagic/master

Circle, ellipse, polygon and rectangle render correctly when their stroke-width is set to zero
parents 0e611506 70dde293
...@@ -89,7 +89,7 @@ namespace Svg ...@@ -89,7 +89,7 @@ namespace Svg
/// </summary> /// </summary>
public override GraphicsPath Path(ISvgRenderer renderer) public override GraphicsPath Path(ISvgRenderer renderer)
{ {
if ((this._path == null || this.IsPathDirty) && base.StrokeWidth > 0) if (this._path == null || this.IsPathDirty)
{ {
float halfStrokeWidth = base.StrokeWidth / 2; float halfStrokeWidth = base.StrokeWidth / 2;
......
...@@ -95,7 +95,7 @@ namespace Svg ...@@ -95,7 +95,7 @@ namespace Svg
/// <value></value> /// <value></value>
public override GraphicsPath Path(ISvgRenderer renderer) public override GraphicsPath Path(ISvgRenderer renderer)
{ {
if ((this._path == null || this.IsPathDirty) && base.StrokeWidth > 0) if (this._path == null || this.IsPathDirty)
{ {
float halfStrokeWidth = base.StrokeWidth / 2; float halfStrokeWidth = base.StrokeWidth / 2;
......
...@@ -61,7 +61,7 @@ namespace Svg ...@@ -61,7 +61,7 @@ namespace Svg
public override GraphicsPath Path(ISvgRenderer renderer) public override GraphicsPath Path(ISvgRenderer renderer)
{ {
if ((this._path == null || this.IsPathDirty) && base.StrokeWidth > 0) if (this._path == null || this.IsPathDirty)
{ {
this._path = new GraphicsPath(); this._path = new GraphicsPath();
this._path.StartFigure(); this._path.StartFigure();
......
...@@ -182,7 +182,7 @@ namespace Svg ...@@ -182,7 +182,7 @@ namespace Svg
/// </summary> /// </summary>
public override GraphicsPath Path(ISvgRenderer renderer) public override GraphicsPath Path(ISvgRenderer renderer)
{ {
if ((_path == null || IsPathDirty) && base.StrokeWidth > 0) if (_path == null || IsPathDirty)
{ {
var halfStrokeWidth = new SvgUnit(base.StrokeWidth / 2); var halfStrokeWidth = new SvgUnit(base.StrokeWidth / 2);
......
...@@ -215,7 +215,7 @@ namespace Svg ...@@ -215,7 +215,7 @@ namespace Svg
/// <param name="renderer">The <see cref="ISvgRenderer"/> object to render to.</param> /// <param name="renderer">The <see cref="ISvgRenderer"/> object to render to.</param>
protected internal virtual bool RenderStroke(ISvgRenderer renderer) protected internal virtual bool RenderStroke(ISvgRenderer renderer)
{ {
if (this.Stroke != null && this.Stroke != SvgColourServer.None) if (this.Stroke != null && this.Stroke != SvgColourServer.None && this.StrokeWidth > 0)
{ {
float strokeWidth = this.StrokeWidth.ToDeviceValue(renderer, UnitRenderingType.Other, this); float strokeWidth = this.StrokeWidth.ToDeviceValue(renderer, UnitRenderingType.Other, this);
using (var brush = this.Stroke.GetBrush(this, renderer, Math.Min(Math.Max(this.StrokeOpacity * this.Opacity, 0), 1), true)) using (var brush = this.Stroke.GetBrush(this, renderer, Math.Min(Math.Max(this.StrokeOpacity * this.Opacity, 0), 1), true))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment