- From: Gavin Kistner <gavin@phrogz.net>
- Date: Mon, 20 Apr 2009 22:04:26 -0600
- To: Ruud Steltenpool <svg@steltenpower.com>
- Cc: "www-svg@w3.org" <www-svg@w3.org>
A test case is a great way to convey a problem precisely, as long as the recipients can, and are motivated to, run your test. Can you summarize the problem you are seeing and what you expected or hoped to see, for those of us without ready access to test this? And, what platform(s) and user agent(s) you see this problem on? -- (-, /\ \/ / /\/ On Apr 19, 2009, at 6:11 PM, Ruud Steltenpool <svg@steltenpower.com> wrote: > According to this: > > <svg xmlns="http://www.w3.org/2000/svg" onclick="calculate()"> > <script type="text/ecmascript"> <![CDATA[ > function calculate(evt) { > bb=document.getElementById("rect").getBBox(); > > rwi=1; > rwp=bb.width; > swp=screen.width; > swi=swp/rwp*rwi; > > rhi=1; > rhp=bb.height; > shp=screen.height; > shi=shp/rhp*rhi; > > sdi=Math.sqrt(swi*swi+shi*shi); > > blah="rect\n"; > blah+=rwi+"x"+rhi+"(inch,given)\n"; > blah+=rwp+"x"+rhp+"(pixels,queried)\n"; > blah+="\n"; > > blah+="screen\n"; > blah+=swp+"x"+shp+"(pixels,queried)\n"; > blah+=swi+"x"+shi+"(inch,calculated)\n"; > blah+="diagonal= "+sdi+" inch\n"; > blah+="(ERROR: in my case a strong exaggeration)"; > blah+="\n"; > blah+="\n"; > > > blah+="Without this ERROR i could of course calculate the > viewBox i need in combination with width='100%' and height='100%' in > order to scale any drawing to the prefered physical size\n"; > blah+="\n"; > > blah+="This ERROR of course also means it's very unprecise/ > unwise to use units (other than pixels) in general"; > > alert(blah); > } > ]]> </script> > <rect id="rect" width="1in" height="1in"/> > </svg> >
Received on Tuesday, 21 April 2009 04:05:41 UTC