Loading ...
Sorry, an error occurred while loading the content.

Re: Unable to draw inside the canvasrect

Expand Messages
  • Andreas Neumann
    ... version= 1.1 ... width= 553 ... the inner width and height of the viewBox (800 700) should have the same aspect ratio as the width and height attribute
    Message 1 of 12 , Dec 1, 2006
    View Source
    • 0 Attachment
      > <svg viewBox="0 0 1024 768" width="100%" height="100%"
      version="1.1"
      > xmlns="http://www.w3.org/2000/svg"
      > xmlns:a3="http://ns.adobe.com/AdobeSVGViewerExtension/3.0/"
      > xmlns:xlink="http://www.w3.org/1999/xlink"
      > xmlns:attrib="http://www.carto.net/attrib"
      > xmlns:batik="http://xml.apache.org/batik/ext"
      > onload="init(evt);startup(evt);" onresize='myMapApp.resetFactors();'
      > zoomAndPan="disable">
      >
      > <svg id="mainMap" x="0" y="0" viewBox="30000 20000 800 700"
      width="553"
      > height="700" cursor="crosshair">

      the inner width and height of the viewBox (800 700) should have the
      same aspect ratio as the width and height attribute of the svg
      element, which is not the case in your example.


      > If u see the above example ...map display from the top left corner
      of the
      > browser..
      > Instead it is displaying the map in middle of the browser .

      this is normal behavior - by default, SVG always centers content if
      the aspectRatio of the browser window does not fit the width and
      height dimensions specified.

      Have a look at:
      http://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute

      where the default (also in your case) being "xMidYMid"

      Maybe you can try fixing the aspect Ratio things and if it still
      fails, provide a full (but simple) example. It is hard to debug large
      examples, but it needs to be a fully working example demonstrating
      that the coordinate transformation fails.

      Andreas
    • Umasurya
      Thanx a lot andreas . I found that aspect ratio problem...It s working now.. Thanx ... From: svg-developers@yahoogroups.com
      Message 2 of 12 , Dec 1, 2006
      View Source
      • 0 Attachment
        Thanx a lot andreas .
        I found that aspect ratio problem...It's working now..


        Thanx
        -----Original Message-----
        From: svg-developers@yahoogroups.com
        [mailto:svg-developers@yahoogroups.com]On Behalf Of Andreas Neumann
        Sent: Friday, December 01, 2006 2:33 PM
        To: svg-developers@yahoogroups.com
        Subject: [svg-developers] Re: Unable to draw inside the canvasrect


        > <svg viewBox="0 0 1024 768" width="100%" height="100%"
        version="1.1"
        > xmlns="http://www.w3.org/2000/svg"
        > xmlns:a3="http://ns.adobe.com/AdobeSVGViewerExtension/3.0/"
        > xmlns:xlink="http://www.w3.org/1999/xlink"
        > xmlns:attrib="http://www.carto.net/attrib"
        > xmlns:batik="http://xml.apache.org/batik/ext"
        > onload="init(evt);startup(evt);" onresize='myMapApp.resetFactors();'
        > zoomAndPan="disable">
        >
        > <svg id="mainMap" x="0" y="0" viewBox="30000 20000 800 700"
        width="553"
        > height="700" cursor="crosshair">

        the inner width and height of the viewBox (800 700) should have the
        same aspect ratio as the width and height attribute of the svg
        element, which is not the case in your example.

        > If u see the above example ...map display from the top left corner
        of the
        > browser..
        > Instead it is displaying the map in middle of the browser .

        this is normal behavior - by default, SVG always centers content if
        the aspectRatio of the browser window does not fit the width and
        height dimensions specified.

        Have a look at:
        http://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute

        where the default (also in your case) being "xMidYMid"

        Maybe you can try fixing the aspect Ratio things and if it still
        fails, provide a full (but simple) example. It is hard to debug large
        examples, but it needs to be a fully working example demonstrating
        that the coordinate transformation fails.

        Andreas






        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.