From cbc71cae7253f766cb0cd0b8e4fde64a73c08e36 Mon Sep 17 00:00:00 2001 From: speleo3 Date: Sat, 29 Nov 2008 13:04:08 +0000 Subject: [PATCH] bug #168777 (consider root transform and viewBox) --- src/text-context.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/text-context.cpp b/src/text-context.cpp index 1dd5e4e82..078d2bece 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -512,6 +512,17 @@ sp_text_context_setup_text(SPTextContext *tc) sp_desktop_selection(ec->desktop)->set(text_item); Inkscape::GC::release(rtext); text_item->transform = SP_ITEM(ec->desktop->currentRoot())->getRelativeTransform(ec->desktop->currentLayer()); + + // bug #168777 (consider root transform and viewBox) + // TODO: more generic solution desirable + Geom::Matrix root_transform = sp_item_i2doc_affine(SP_ITEM(ec->desktop->currentRoot())); + if (!root_transform.isIdentity()) { + text_item->transform = root_transform.inverse() * text_item->transform; + Geom::Point pdoc = tc->pdoc * root_transform; + sp_repr_set_svg_double(rtext, "x", pdoc[Geom::X]); + sp_repr_set_svg_double(rtext, "y", pdoc[Geom::Y]); + } + text_item->updateRepr(); sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, _("Create text")); -- 2.30.2