Inkscape.org
Beyond the Basics Found different preview on Inkscape and on webbrowser
  1. #1
    do2z do2z @do2z

    Hello

    I recently started to use <symbol> in Inkscape. In my example, I set a viewport and a viewbox to restrict the displayed area of the drawing. I'm surprised of the inkscape preview as the symbol is not cropped. On the attached file, you can see that the second circle is cropped on the webrowser at the height and width defined in the symbol tag whereas it's not in Inkscape preview.

    Am I missing something ? Any attribute ?

    This is the SVG code block :

       <defs
          id="defs2">
          <symbol
             id="myDot"
             width="22"
             height="20"
             viewBox="0 0 22 20"
             preserveAspectRatio="xMidYMid slice">
             <circle
                cx="5"
                cy="5"
                r="5"
                id="circle11602" />
             <circle
                cx="20"
                cy="20"
                r="5"
                id="circle11604" />
          </symbol>
       </defs>
       <g
          inkscape:label="Calque 1"
          inkscape:groupmode="layer"
          id="layer1"
          style="opacity:1">
          <path
             d="M 0,20 H 100 M 20,0 V 20 M 40,0 V 20 M 60,0 V 20 M 80,0 V 20 M 100,0 v 20"
             fill="none"
             stroke="#ffc0cb"
             id="path11608" />
          <use xlink:href="#myDot" x="0" y="0" style="opacity:1.0" />
          <use xlink:href="#myDot" x="20" y="0" style="opacity:0.8" />
          <use xlink:href="#myDot" x="40" y="0" style="opacity:0.6" />
          <use xlink:href="#myDot" x="60" y="0" style="opacity:0.4" />
          <use xlink:href="#myDot" x="80" y="0" style="opacity:0.2" />
       </g>

    Thank you for your help

    For information, I'm using Inkscape 1.2.2 (732a01da63, 2022-12-09) on Windows 11.

    Ed

     

    Draft Viewbox Viewport
    2025 01 18 À 09.12.45 Inkscape Preview
    2025 01 18 091654 Webbrowser Preview
  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    I'd call it a bug.  https://inkscape.org/forums/beyond/how-to-report-bugs-or-request-new-features/

  3. #3
    do2z do2z @do2z

    Ok, thank you for your answer. I'll report it then.

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Found different preview on Inkscape and on webbrowser