summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d2f452)
raw | patch | inline | side by side (parent: 4d2f452)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 25 Jan 2009 00:16:22 +0000 (00:16 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 25 Jan 2009 00:16:22 +0000 (00:16 +0000) |
src/sp-ellipse.cpp | patch | blob | history |
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 0d28e9f6b370b2c94c2aca77ddd1df4b39b3348a..b5f3df1cb83567d798b9c37bfdcacee0269b0c40 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
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);
}