From 5420b476f4668b03f4ce169494792c78b3a3235d Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 6 Jan 2015 13:37:55 +0100 Subject: Add getDocumentScale() to return "real-world" to "user-unit" scale factor. Use it to correct text postion after removing from path. (bzr r13843) --- src/sp-tspan.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/sp-tspan.cpp') diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index c3f7689e7..147efff33 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -42,6 +42,7 @@ #include "style.h" #include "xml/repr.h" #include "document.h" +#include "2geom/transforms.h" #include "sp-factory.h" @@ -447,7 +448,8 @@ void sp_textpath_to_text(SPObject *tp) } Geom::Point xy = bbox->min(); - + xy *= tp->document->getDocumentScale().inverse(); // Convert to user-units. + // make a list of textpath children GSList *tp_reprs = NULL; @@ -468,7 +470,7 @@ void sp_textpath_to_text(SPObject *tp) tp->deleteObject(); g_slist_free(tp_reprs); - // set x/y on text + // set x/y on text (to be near where it was when on path) /* fixme: Yuck, is this really the right test? */ if (xy[Geom::X] != 1e18 && xy[Geom::Y] != 1e18) { sp_repr_set_svg_double(text->getRepr(), "x", xy[Geom::X]); -- cgit v1.2.3