<rect> zero radius handling not conformant

Bug #1533302 reported by Roy Hashimoto
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Medium
Unassigned

Bug Description

Inkscape does not handle a <rect> element with one radius attribute (rx or ry) explicitly zero and the other non-zero according to the spec. Instead it behaves as though both radii are set to the non-zero value.

The SVG spec says that if a properly specified value is not supplied for one radius, both radii are set to the other value. Inkscape appears to be applying that here, but I believe this is incorrect as 0 is a properly specified value. If any radius is zero then a degenerate ellipse is produced which should result in square corners.

I have attached a very simple example that has a <rect> element with the rx attribute explicitly set to 0 and a non-zero ry attribute. Inkscape (and Chrome, Safari, and IE 11) renders the shape with rounded corners. Firefox renders it correctly with square corners.

The problem is also present on output. If you create a rectangle in Inkscape with one zero radius and one non-zero radius, it is rendered with rounded corners. I guess that's not necessarily wrong because Inkscape's conventions don't necessarily have to be the same as SVG. However, when this rectangle is written to an SVG file, it should either have both radii attributes written with the same value or the zero radius attribute should be omitted to ensure that other applications render it properly.

=====

Inkscape 0.91 r13725 on Mac OS X 10.10.5.

Revision history for this message
Roy Hashimoto (roy-hashimoto) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Please add information about OS/platform and Inkscape version to the bug description, thank you.

Changed in inkscape:
status: New → Incomplete
Revision history for this message
Roy Hashimoto (roy-hashimoto) wrote :

Inkscape 0.91 r13725 on Mac OS X 10.10.5.

Changed in inkscape:
status: Incomplete → New
su_v (suv-lp)
description: updated
tags: added: shape-editing svg
Mc (mc...)
Changed in inkscape:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Shlomi Fish (shlomif-gmail) wrote :

This is a tentative patch that fixes the symptoms of the problem. I still want to add tests.

Revision history for this message
Mc (mc...) wrote :

(irc excerpt)

21:21 < Mc> nah
21:22 < Mc> you're changing the intended behavior
21:22 < Mc> you're basically reverting the fix to https://bugs.launchpad.net/inkscape/+bug/481805 :)
21:23 < Mc> ( http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12255 )
21:28 < rindolf> Mc: why can't an rx or ry be 0?
21:29 < Mc> basically, when you drag the round handles in rect mode, setting it "to 0" (to the corner) is the UI way of disabling it
21:30 < Mc> and 0, in SVG, means that the corners are sharp, whatever the other handle says, while you'd want an easy UI way to set a circle (not ellipse) corner and setting rx=0, ry!=0 is basically useless
21:31 < Mc> so, rx or ry "can" be 0, but if so, then you'd want a way to preserve current UI behavior anyway, one way or another

Changed in inkscape:
importance: High → Medium
Revision history for this message
Nathan Lee (nathan.lee) wrote :

Hi - thanks for reporting this bug, I've manually migrated it to Inkscape's new
bug tracker on GitLab at https://gitlab.com/inkscape/inbox/-/issues/6875, and closed it here.

Please feel free to file new bugs about the issues you're seeing at http://inkscape.org/report.

Changed in inkscape:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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