summaryrefslogtreecommitdiffstats
path: root/src/sp-ellipse.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-27 14:58:22 +0000
committerKrzysztof Kosinski <tweenk.pl@gmail.com>2011-08-27 14:58:22 +0000
commit24526cceccb4ed103a6324756476c64efb3fb5dd (patch)
tree24abb1d2b1bdb6156a83f2d393cbdc4747fda4ac /src/sp-ellipse.cpp
parentRemove NRRect from paint servers and temporary calculations (diff)
downloadinkscape-24526cceccb4ed103a6324756476c64efb3fb5dd.tar.gz
inkscape-24526cceccb4ed103a6324756476c64efb3fb5dd.zip
Remove all NRRect use.
(bzr r10582.1.5)
Diffstat (limited to 'src/sp-ellipse.cpp')
-rw-r--r--src/sp-ellipse.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 99189da45..ba100a1d7 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -140,19 +140,18 @@ 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;
- Geom::OptRect viewbox = ((SPItemCtx const *) ctx)->vp;
- if (viewbox) {
- 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, dx);
- ellipse->cy.update(em, ex, dy);
- ellipse->rx.update(em, ex, dr);
- ellipse->ry.update(em, ex, dr);
- static_cast<SPShape *>(object)->setShape();
- }
+ Geom::Rect const &viewbox = ((SPItemCtx const *) ctx)->viewport;
+
+ 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, dx);
+ ellipse->cy.update(em, ex, dy);
+ ellipse->rx.update(em, ex, dr);
+ ellipse->ry.update(em, ex, dr);
+ static_cast<SPShape *>(object)->setShape();
}
if (((SPObjectClass *) ge_parent_class)->update)