summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2009-01-25 00:16:22 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2009-01-25 00:16:22 +0000
commit2d6e8ddb1cd88a9bdb7369037811f2c83ec4164f (patch)
tree85dcea9f3fcdab4cb3ba6fcdaf1853f351eb192a /src
parentmove most of the new LPEs to the experimental section, this means that most o... (diff)
downloadinkscape-2d6e8ddb1cd88a9bdb7369037811f2c83ec4164f.tar.gz
inkscape-2d6e8ddb1cd88a9bdb7369037811f2c83ec4164f.zip
fix percentage coordinates for ellipses. (svgtestsuite-1.1/coords-units-02-b.svg)
(bzr r7168)
Diffstat (limited to 'src')
-rw-r--r--src/sp-ellipse.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 0d28e9f6b..b5f3df1cb 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -143,13 +143,16 @@ sp_genericellipse_update(SPObject *object, SPCtx *ctx, guint flags)
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
SPGenericEllipse *ellipse = (SPGenericEllipse *) object;
SPStyle const *style = object->style;
- double const d = 1.0 / NR::expansion(((SPItemCtx const *) ctx)->i2vp);
+ Geom::OptRect viewbox = ((SPItemCtx const *) ctx)->vp;
+ double const dx = viewbox->width();
+ double const dy = viewbox->height();
+ double const dr = sqrt(dx*dx + dy*dy)/sqrt(2);
double const em = style->font_size.computed;
double const ex = em * 0.5; // fixme: get from pango or libnrtype
- ellipse->cx.update(em, ex, d);
- ellipse->cy.update(em, ex, d);
- ellipse->rx.update(em, ex, d);
- ellipse->ry.update(em, ex, d);
+ ellipse->cx.update(em, ex, dx);
+ ellipse->cy.update(em, ex, dy);
+ ellipse->rx.update(em, ex, dr);
+ ellipse->ry.update(em, ex, dr);
sp_shape_set_shape((SPShape *) object);
}