Commit 9294fa77 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #47 from andreichuk/changes

offset of Gradient stop
parents 3fb1b28b acfafb89
...@@ -25,7 +25,32 @@ namespace Svg ...@@ -25,7 +25,32 @@ namespace Svg
get { return this._offset; } get { return this._offset; }
set set
{ {
this._offset = value.ToPercentage(); SvgUnit unit = value;
if (value.Type == SvgUnitType.Percentage)
{
if (value.Value > 100)
{
unit = new SvgUnit(value.Type, 100);
}
else if (value.Value < 0)
{
unit = new SvgUnit(value.Type, 0);
}
}
else if (value.Type == SvgUnitType.User)
{
if (value.Value > 1)
{
unit = new SvgUnit(value.Type, 1);
}
else if (value.Value < 0)
{
unit = new SvgUnit(value.Type, 0);
}
}
this._offset = unit.ToPercentage();
} }
} }
......
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