summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--configure.in2
-rw-r--r--rsvg-path.c8
-rw-r--r--rsvg-shapes.c13
4 files changed, 29 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d6b73b7..f48d7939 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-03-14 Dom Lachowicz <cinamod@hotmail.com>
+
+ * rsvg-path.c (rsvg_path_arc): Fix NaN issue, bug 108380
+ * rsvg-shapes.c (start_rect): SVG conformance issues fixed
+
+=== librsvg 2.2.4 ===
+
+2003-03-10 Dom Lachowicz <cinamod@hotmail.com>
+
+ * configure.in: Bump version number
+
2003-02-26 Dom Lachowicz <cinamod@hotmail.com>
* rsvg.c (close_impl): Fix bug 106399
diff --git a/configure.in b/configure.in
index 12861c57..11285836 100644
--- a/configure.in
+++ b/configure.in
@@ -20,7 +20,7 @@ dnl ===========================================================================
LIBRSVG_MAJOR_VERSION=2
LIBRSVG_MINOR_VERSION=2
-LIBRSVG_MICRO_VERSION=3
+LIBRSVG_MICRO_VERSION=4
AC_SUBST(LIBRSVG_MAJOR_VERSION)
AC_SUBST(LIBRSVG_MINOR_VERSION)
AC_SUBST(LIBRSVG_MICRO_VERSION)
diff --git a/rsvg-path.c b/rsvg-path.c
index fe11b208..f1ef974f 100644
--- a/rsvg-path.c
+++ b/rsvg-path.c
@@ -115,6 +115,14 @@ rsvg_path_arc (RSVGParsePathCtx *ctx,
double th0, th1, th_arc;
int i, n_segs;
+ /* Check that neither radius is zero, since its isn't either
+ geometrically or mathematically meaningful and will
+ cause divide by zero and subsequent NaNs. We should
+ really do some ranged check ie -0.001 < x < 000.1 rather
+ can just a straight check again zero.
+ */
+ if ((rx == 0.0) || (ry == 0.0)) return;
+
sin_th = sin (x_axis_rotation * (M_PI / 180.0));
cos_th = cos (x_axis_rotation * (M_PI / 180.0));
a00 = cos_th / rx;
diff --git a/rsvg-shapes.c b/rsvg-shapes.c
index 51b5e3df..5d9bdc78 100644
--- a/rsvg-shapes.c
+++ b/rsvg-shapes.c
@@ -440,7 +440,7 @@ void
rsvg_start_rect (RsvgHandle *ctx, const xmlChar **atts)
{
int i;
- double x = -1, y = -1, w = -1, h = -1, rx = 0., ry = 0.;
+ double x = 0., y = 0., w = -1, h = -1, rx = 0., ry = 0.;
GString * d = NULL;
const char * klazz = NULL, * id = NULL;
RsvgState *state;
@@ -482,10 +482,15 @@ rsvg_start_rect (RsvgHandle *ctx, const xmlChar **atts)
if (got_rx && !got_ry)
ry = rx;
else if (got_ry && !got_rx)
- rx = ry;
-
- if (x < 0. || y < 0. || w < 0. || h < 0. || rx < 0. || ry < 0.)
+ rx = ry;
+
+ if (x < 0. || y < 0. || w <= 0. || h <= 0. || rx < 0. || ry < 0.)
return;
+
+ if (rx > (w / 2.))
+ rx = w / 2.;
+ if (ry > (h / 2.))
+ ry = h / 2.;
rsvg_parse_style_attrs (ctx, "rect", klazz, id, atts);