Markers scaled incorrectly when no viewBox is specified

Bug #1690952 reported by Patrick Storz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

If a marker does not specify a viewBox Inkscape uses the full size of this marker when scaling to path width.

E.g. if a marker defined as a square with dimensions 10 x 10 px² is rendered on a path with stroke-width="10px", the resulting markers dimensions will be 100 x 100 px².

However if I understand the spec [1] correctly in this case the defaults for markerWidth/markerHeight should be used (which is 3 px), and (fitting the marker into these 3 x 3 px²) the resulting markers dimensions should be 30 x 30 px²

The latter implementation is used by Firefox and librsvg.
(I'm attaching a testcase as well as renderings of Inkscape, Firefox and librsvg)

[1] https://www.w3.org/TR/SVG/painting.html#MarkerElement

Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :

Another issue (maybe related, maybe not) is that Inkscape fails to render the marker (see attached screenshot).

It seems the markers size is limited to the page size. Only at very small zoom levels the whole marker is shown. (This is also true for a huge marker with viewBox, i.e. one that is rendered in the correct size in principle)

Revision history for this message
Patrick Storz (ede123) wrote :

@Tavmjong: Subscribing you, as I'm not yet 100% sure I correctly understood the spec... maybe you could confirm if this is an issue or not?

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

The size of the rectangle is irrelevant. It does not establish a viewport size. The marker is being rendered by all browsers and Inkscape without scaling due to a view port. The inconsistency is that Inkscape is not properly clipping the marker. The browsers (Opera/Chrome/Firefox) clip the marker to a 3x3 square (or 300x300 square after the <svg> viewBox and 10px stroke width is accounted for). This can be seen by adding a stroke to the rectangle in the marker. All browsers and Inskcape give the same rendering when 'overflow' is set to 'visible' on the <marker> element.

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.