Commit b12c63d1 authored by mrbean-bremen's avatar mrbean-bremen
Browse files

Do not create a clip region for view box

- a view box does not need a clip region, this breaks the overflow
handling
- overflow handling:  handle overflow attribut "Inherit" as Visible and
"Scroll" as Hidden as per W3C documentation
- fixes #279
parent 0b727f1b
......@@ -200,7 +200,6 @@ namespace Svg
}
}
renderer.SetClip(new Region(new RectangleF(x, y, width, height)), CombineMode.Intersect);
renderer.TranslateTransform(x, y, MatrixOrder.Prepend);
renderer.TranslateTransform(fMinX, fMinY, MatrixOrder.Prepend);
renderer.ScaleTransform(fScaleX, fScaleY, MatrixOrder.Prepend);
......
......@@ -165,7 +165,7 @@ namespace Svg
{
case SvgOverflow.Auto:
case SvgOverflow.Visible:
case SvgOverflow.Scroll:
case SvgOverflow.Inherit:
base.Render(renderer);
break;
default:
......
<svg version="1.1" baseProfile="basic" width="480" height="360"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title id="test-title">Test data for issue 279 - overflow not shown with viewbox on svg fragment</title>
<g fill="lightblue" stroke="black">
<svg x="35" y="50" width="100" height="100" viewBox="0 0 150 150" overflow="visible">
<path fill-rule="evenodd" d="M20,20 Q180,20 180,180 Q20,180 20,20 Z M20,180 Q20,20 180,20 Q180,180 20,180 Z M100,40 L160,100 100,160 40,100 Z"/>
</svg>
<text font-size="13.5" x="100" y="190" text-anchor="middle" fill="black" stroke="none">viewBox="0 0 150 150"</text>
<text font-size="13.5" x="100" y="205" text-anchor="middle" fill="black" stroke="none">overflow="visible" </text>
<svg x="250" y="50" width="100" height="100" viewBox="0 0 150 150" overflow="hidden">
<path fill-rule="evenodd" d="M20,20 Q180,20 180,180 Q20,180 20,20 Z M20,180 Q20,20 180,20 Q180,180 20,180 Z M100,40 L160,100 100,160 40,100 Z"/>
</svg>
<text font-size="13.5" x="315" y="190" text-anchor="middle" fill="black" stroke="none">viewBox="0 0 150 150"</text>
<text font-size="13.5" x="315" y="205" text-anchor="middle" fill="black" stroke="none">overflow="hidden" </text>
</g>
</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