Commit ad63cd65 authored by heindlalex's avatar heindlalex Committed by mrbean-bremen
Browse files

Added "stroke-dashoffset" support (#390)

- added "stroke-dashoffset" support
- added "painting-stroke-04-t" to "PassingTests" (csv/txt)
- fixes #388 
parent 41f66eb6
...@@ -254,6 +254,12 @@ namespace Svg ...@@ -254,6 +254,12 @@ namespace Svg
/* divide by stroke width - GDI behaviour that I don't quite understand yet.*/ /* divide by stroke width - GDI behaviour that I don't quite understand yet.*/
pen.DashPattern = this.StrokeDashArray.ConvertAll(u => ((u.ToDeviceValue(renderer, UnitRenderingType.Other, this) <= 0) ? 1 : u.ToDeviceValue(renderer, UnitRenderingType.Other, this)) / pen.DashPattern = this.StrokeDashArray.ConvertAll(u => ((u.ToDeviceValue(renderer, UnitRenderingType.Other, this) <= 0) ? 1 : u.ToDeviceValue(renderer, UnitRenderingType.Other, this)) /
((strokeWidth <= 0) ? 1 : strokeWidth)).ToArray(); ((strokeWidth <= 0) ? 1 : strokeWidth)).ToArray();
if (this.StrokeDashOffset != null && this.StrokeDashOffset.Value != 0)
{
pen.DashOffset = ((this.StrokeDashOffset.ToDeviceValue(renderer, UnitRenderingType.Other, this) <= 0) ? 1 : this.StrokeDashOffset.ToDeviceValue(renderer, UnitRenderingType.Other, this)) /
((strokeWidth <= 0) ? 1 : strokeWidth);
}
} }
switch (this.StrokeLineJoin) switch (this.StrokeLineJoin)
{ {
......
...@@ -49,6 +49,7 @@ painting-fill-03-t ...@@ -49,6 +49,7 @@ painting-fill-03-t
painting-fill-05-b painting-fill-05-b
painting-stroke-01-t painting-stroke-01-t
painting-stroke-02-t painting-stroke-02-t
painting-stroke-04-t
painting-stroke-09-t painting-stroke-09-t
painting-stroke-10-t painting-stroke-10-t
paths-data-01-t paths-data-01-t
......
...@@ -174,6 +174,7 @@ text-ws-02-t.svg ...@@ -174,6 +174,7 @@ text-ws-02-t.svg
text-ws-03-t.svg text-ws-03-t.svg
types-basic-01-f.svg types-basic-01-f.svg
painting-stroke-02-t.svg painting-stroke-02-t.svg
painting-stroke-04-t.svg
coords-viewattr-04-f.svg coords-viewattr-04-f.svg
fonts-desc-01-t.svg fonts-desc-01-t.svg
fonts-elem-05-t.svg fonts-elem-05-t.svg
......
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