From: speleo3 Date: Sat, 29 Nov 2008 13:04:08 +0000 (+0000) Subject: bug #168777 (consider root transform and viewBox) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cbc71cae7253f766cb0cd0b8e4fde64a73c08e36;p=inkscape.git bug #168777 (consider root transform and viewBox) --- 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"));