automatic ViewBox creation

Bug #170965 reported by Bug Importer
2
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
Unassigned

Bug Description

You can make SVG graphics that are automatically zoomed
to take over available space by adding the attributes
viewBox="0 0 width height" and
preserveAspectRatio="xMidYMid meet" to the main SVG
element, where length and height are as specified by
their attributes in said element . Please include a
checkbox to do so in the document settings.

Also, since there's an apparent bug in Inkview that
makes the main clip path not set properly (content
leaks over page edge), the checkbox should also insert
the attributes overflow="hidden" and
clip-path="url(#mainclip)" to the outermost SVG
element, and the following code to the defs section:

<clipPath id="mainclip">
  <path
    id="dummypath1"
    d="M 0,0 L width,0 L width,height L 0,height L 0,0"
  />
</clipPath>

This works and properly hides the out-of-page content
in Inkview.

Tags: viewbox
Hystrix (hystrix-)
Changed in inkscape:
importance: Undecided → Wishlist
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

The attribute overflow="hidden" should not be necessary, as this is the default for SVG: http://www.w3.org/TR/SVG11/masking.html#InitialClippingPath

And I think the creation of a clip path is a bit overhead. When clipping to the viewBox is wanted, Inkscape should add an according "clip" attribute, as described in http://www.w3.org/TR/SVG11/masking.html#AutoClipAtViewportNotViewBox

But the automatic viewBox creation is of course the most urgent and has been requested many times.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.