diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index 0eeac8c4f7c3008a9471f2a3e1cd0651703d1d42..f574b69fb14a6628f693373dac3927d2c9fc27e1 100644 (file)
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
SPItem *flowtext = SP_ITEM(items->data);
+ // we discard transform when unflowing, but we must preserve expansion which is visible as
+ // font size multiplier
+ double ex = (flowtext->transform).descrim();
+
if (sp_te_get_string_multiline(flowtext) == NULL) { // flowtext is empty
continue;
}
NRRect bbox;
sp_item_invoke_bbox(SP_ITEM(flowtext), &bbox, sp_item_i2doc_affine(SP_ITEM(flowtext)), TRUE);
- NR::Point xy(bbox.x0, bbox.y0);
- if (xy[NR::X] != 1e18 && xy[NR::Y] != 1e18) {
- sp_repr_set_svg_double(rtext, "x", xy[NR::X]);
- sp_repr_set_svg_double(rtext, "y", xy[NR::Y]);
+ Geom::Point xy(bbox.x0, bbox.y0);
+ if (xy[Geom::X] != 1e18 && xy[Geom::Y] != 1e18) {
+ sp_repr_set_svg_double(rtext, "x", xy[Geom::X]);
+ sp_repr_set_svg_double(rtext, "y", xy[Geom::Y]);
}
/* Create <tspan> */
SP_OBJECT_REPR(SP_OBJECT_PARENT(flowtext))->appendChild(rtext);
SPObject *text_object = doc->getObjectByRepr(rtext);
+ // restore the font size multiplier from the flowtext's transform
+ SP_TEXT(text_object)->_adjustFontsizeRecursive(SP_ITEM(text_object), ex);
+
new_objs = g_slist_prepend (new_objs, text_object);
old_objs = g_slist_prepend (old_objs, flowtext);