# SVG11: problem with rounded rect specification

From: Peter Moulder <Peter.Moulder@infotech.monash.edu.au>
Date: Sat, 14 Aug 2004 01:47:23 +1000

Message-id: <20040813154723.GA16239@bowman.csse.monash.edu.au>
```
The relevant text is the first paragraph after
http://www.w3.org/TR/SVG11/shapes.html#RectElementRYAttribute.

If exactly one of rx, ry is specified then the relevant sentences are:

# If a properly specified value is provided for rx but not for ry, then
# the user agent processes the 'rect' element with the effective value
# for ry as equal to rx.

# If a properly specified value is provided for ry but not for rx, then
# the user agent processes the 'rect' element with the effective value
# for rx as equal to ry.

# If rx is greater than half of the width of the rectangle, then the
# user agent processes the 'rect' element with the effective value for
# rx as half of the width of the rectangle.

# If ry is greater than half of the height of the rectangle, then the
# user agent processes the 'rect' element with the effective value for
# ry as half of the height of the rectangle.

Take the case width=100, height=10, rx=30 (and ry unspecified).
Then by the first sentence, the effective value for ry = rx (presumably
meaning ry=30).

The simplest interpretation of the fourth sentence is that ry isn't
specified, so this sentence doesn't apply, and we have rx=30,ry=30.
Which would give an interesting-looking shape given that height=10.

The implementor might then conclude that the fourth sentence is to be
read as "If the effective value for ry is greater than .5 * h then the
effective value for ry is .5 * h."  But this is a contradiction: it
can't be both equal and greater than .5*h.  So onto our next try:
interpret the sentences not as mathematical statements but as
"assignments" to rx and ry.  This would make the final values depend on
the order of evaluation (e.g. whether `ry := rx' or `ry := .5 * h' is
the ultimate assignment) so let's take the sentences as to be applied
strictly in the order given, and discard the earlier stipulation that
"the effective value for ry [be] equal to rx" for our example.

I'm guessing that rx=30, ry=5 is the desired result for our example, but
I'm far from certain.  Note that the sentences look like they are to be
interpreted as mathematical statements, and so a casual reader might
infer from the first sentence that the arcs should be circular in our
example (in the current coordinate system at least).

I suggest either explicitly expressing as a sequence of assignments, or
(better) expressing as non-contradictory statements expressing the
effective rx,ry as a function of the provided values (if any) for rx,ry.

Also, it doesn't seem clear how CSS rules interact with the meaning of
"provided value".  However, I haven't carefully read
http://www.w3.org/TR/SVG11/styling.html.  (Of course it might be nice if
one needn't thoroughly read other parts of the spec to know whether or
not those other parts are relevant to the interpretation of the
shapes.html page.)

pjrm.
```
Received on Saturday, 14 August 2004 04:59:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:59 UTC