summaryrefslogtreecommitdiffstats
path: root/src/sp-ellipse.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2010-10-23 20:40:34 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2010-10-23 20:40:34 +0000
commit79d2d04dba2b780a696e1872891dc92983cfc2dd (patch)
tree4bf31a52ac3b577cccd5e6ea23785d0fdeac19e9 /src/sp-ellipse.cpp
parentDon't try displaying markers for completely empty paths, fixes crash. (diff)
downloadinkscape-79d2d04dba2b780a696e1872891dc92983cfc2dd.tar.gz
inkscape-79d2d04dba2b780a696e1872891dc92983cfc2dd.zip
Fix updating for ellipses when viewbox is not defined
Fixed bugs: - https://launchpad.net/bugs/587897 (bzr r9844)
Diffstat (limited to 'src/sp-ellipse.cpp')
-rw-r--r--src/sp-ellipse.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 88fc59f17..dbc5b1407 100644
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -144,16 +144,18 @@ sp_genericellipse_update(SPObject *object, SPCtx *ctx, guint flags)
SPGenericEllipse *ellipse = (SPGenericEllipse *) object;
SPStyle const *style = object->style;
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, 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);
+ 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);
+ sp_shape_set_shape((SPShape *) object);
+ }
}
if (((SPObjectClass *) ge_parent_class)->update)