Commit 45a2f4e8 authored by Chris Moore's avatar Chris Moore
Browse files

Fix for GDI crash if stroke-dasharray contains value<=0

GDI Pen was crashing with some bad (Adobe Illustrator) data that had: stroke-dasharray="10,10,0"
parent 3f90e468
......@@ -163,7 +163,7 @@ namespace Svg
if (this.StrokeDashArray != null && this.StrokeDashArray.Count > 0)
{
/* divide by stroke width - GDI behaviour that I don't quite understand yet.*/
pen.DashPattern = this.StrokeDashArray.ConvertAll(u => u.Value/((strokeWidth <= 0) ? 1 : strokeWidth)).ToArray();
pen.DashPattern = this.StrokeDashArray.ConvertAll(u => ((u.Value <= 0) ? 1 : u.Value) / ((strokeWidth <= 0) ? 1 : strokeWidth)).ToArray();
}
renderer.DrawPath(pen, this.Path);
......@@ -247,4 +247,4 @@ namespace Svg
}
}
}
\ No newline at end of file
}
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