Export to GitHub

svgweb - issue #297

Aspect resolution of viewBox not honored on resize of browser


Posted on Sep 16, 2009 by Grumpy Dog

What steps will reproduce the problem?

Included is a minimal html and svg file. Render it then resize the browser. Even though the object size may be correct, the viewBox aspect resolution is not honored.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <script src="src/svg.js" data-path="src/" type="text/javascript"></script> </head> <body> <!--[if IE]><object src="svg.svg" classid="image/svg+xml" width="100%" height="100%" ><![endif]--> <!--[if !IE]>--><object data="svg.svg" type="image/svg+xml" width="100%" height="100%" ><!--<![endif]--></object> </body> </html>

This is svg.svg:

<?xml version="1.0"?> <svg version="1.1" xmlns="http://www.w3.org/2000/svg&quot; viewBox="0 0 1500 1000" preserveAspectRatio='xMidYMid meet' width="100%" height="100%"> <rect x="0" y="0" width="1500" height="1000" fill="yellow" stroke="blue" stroke-width="12" /> <path fill="red" d="M 750,100 L 250,900 L 1250,900 z" /> </svg>

Comment #1

Posted on Oct 17, 2009 by Grumpy Dog

Fixed in r932.

Status: Fixed

Labels:
Type-Defect Priority-Medium