summaryrefslogtreecommitdiffstats
path: root/src/text-editing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/text-editing.cpp')
-rw-r--r--src/text-editing.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/text-editing.cpp b/src/text-editing.cpp
index be427715e..231d834ca 100644
--- a/src/text-editing.cpp
+++ b/src/text-editing.cpp
@@ -1797,9 +1797,24 @@ void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &sta
The recursion may involve creating new spans.
*/
SPObject *common_ancestor = get_common_ancestor(text, start_item, end_item);
+
+ // bug #168370 (consider parent transform and viewBox)
+ // snipplet copied from desktop-style.cpp sp_desktop_apply_css_recursive(...)
+ SPCSSAttr *css_set = sp_repr_css_attr_new();
+ sp_repr_css_merge(css_set, (SPCSSAttr*) css);
+ {
+ Geom::Matrix const local(sp_item_i2doc_affine(SP_ITEM(common_ancestor)));
+ double const ex(local.descrim());
+ if ( ( ex != 0. )
+ && ( ex != 1. ) ) {
+ sp_css_attr_scale(css_set, 1/ex);
+ }
+ }
+
start_item = ascend_while_first(start_item, start_text_iter, common_ancestor);
end_item = ascend_while_first(end_item, end_text_iter, common_ancestor);
- recursively_apply_style(common_ancestor, css, start_item, start_text_iter, end_item, end_text_iter, span_name_for_text_object(text));
+ recursively_apply_style(common_ancestor, css_set, start_item, start_text_iter, end_item, end_text_iter, span_name_for_text_object(text));
+ sp_repr_css_attr_unref(css_set);
/* stage 2: cleanup the xml tree (of which there are multiple passes) */
/* discussion: this stage requires a certain level of inventiveness because