diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2009-01-25 00:24:16 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2009-01-25 00:24:16 +0000 |
| commit | 5d3d6f77edafee6be2cea525637198dc15dd934a (patch) | |
| tree | 458c27a8f3ac8cce53fba4b2c7091f6078812d1e /src | |
| parent | fix percentage coordinates for ellipses. (svgtestsuite-1.1/coords-units-02-b.... (diff) | |
| download | inkscape-5d3d6f77edafee6be2cea525637198dc15dd934a.tar.gz inkscape-5d3d6f77edafee6be2cea525637198dc15dd934a.zip | |
fix percentage coordinates for rect and line. (svgtestsuite-1.1/coords-units-02-b.svg)
(bzr r7169)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-line.cpp | 12 | ||||
| -rw-r--r-- | src/sp-rect.cpp | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/sp-line.cpp b/src/sp-line.cpp index a3964b171..946d5d0e6 100644 --- a/src/sp-line.cpp +++ b/src/sp-line.cpp @@ -142,13 +142,15 @@ sp_line_update (SPObject *object, SPCtx *ctx, guint flags) SPLine *line = SP_LINE (object); SPStyle const *style = object->style; - double const d = 1.0 / NR::expansion(((SPItemCtx const *) ctx)->i2vp); + SPItemCtx const *ictx = (SPItemCtx const *) ctx; + double const w = (ictx->vp.x1 - ictx->vp.x0); + double const h = (ictx->vp.y1 - ictx->vp.y0); double const em = style->font_size.computed; double const ex = em * 0.5; // fixme: get from pango or libnrtype. - line->x1.update(em, ex, d); - line->x2.update(em, ex, d); - line->y1.update(em, ex, d); - line->y2.update(em, ex, d); + line->x1.update(em, ex, w); + line->x2.update(em, ex, w); + line->y1.update(em, ex, h); + line->y2.update(em, ex, h); sp_shape_set_shape ((SPShape *) object); } diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index c2fe527b6..c88b9eb38 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -174,9 +174,8 @@ sp_rect_update(SPObject *object, SPCtx *ctx, guint flags) SPRect *rect = (SPRect *) object; SPStyle *style = object->style; SPItemCtx const *ictx = (SPItemCtx const *) ctx; - double const d = ictx->i2vp.descrim(); - double const w = (ictx->vp.x1 - ictx->vp.x0) / d; - double const h = (ictx->vp.y1 - ictx->vp.y0) / d; + double const w = (ictx->vp.x1 - ictx->vp.x0); + double const h = (ictx->vp.y1 - ictx->vp.y0); double const em = style->font_size.computed; double const ex = 0.5 * em; // fixme: get x height from pango or libnrtype. rect->x.update(em, ex, w); |
