diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-12-10 10:56:24 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-12-10 10:56:24 +0000 |
| commit | 778f9268123b5ea719931753005d9e2267ead01b (patch) | |
| tree | a63c98af88f46c4cd78ee0c74b316da4efbd962e /src/widgets/text-toolbar.cpp | |
| parent | Add button to access outer text style ('font-size', 'line-height'). These det... (diff) | |
| download | inkscape-778f9268123b5ea719931753005d9e2267ead01b.tar.gz inkscape-778f9268123b5ea719931753005d9e2267ead01b.zip | |
Correct outer text style input for non-px based files.
(bzr r15316)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 520efb421..93b9e56d0 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -236,10 +236,21 @@ static void sp_text_fontsize_value_changed( Ink_ComboBoxEntry_Action *act, GObje Inkscape::Selection *selection = desktop->getSelection(); auto itemlist= selection->items(); for(auto i=itemlist.begin();i!=itemlist.end(); ++i){ - if (dynamic_cast<SPText *>(*i) || - dynamic_cast<SPFlowtext *>(*i)) { + if (dynamic_cast<SPText *>(*i) || dynamic_cast<SPFlowtext *>(*i)) { SPItem *item = *i; - item->changeCSS(css,"style"); + + // Scale by inverse of accumulated paraent transform + SPCSSAttr *css_set = sp_repr_css_attr_new(); + sp_repr_css_merge(css_set, css); + Geom::Affine const local(item->i2doc_affine()); + double const ex(local.descrim()); + if ( (ex != 0.0) && (ex != 1.0) ) { + sp_css_attr_scale(css_set, 1/ex); + } + + item->changeCSS(css_set,"style"); + + sp_repr_css_attr_unref(css_set); } } } else { @@ -585,10 +596,21 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl ) Inkscape::Selection *selection = desktop->getSelection(); auto itemlist= selection->items(); for(auto i=itemlist.begin();i!=itemlist.end(); ++i){ - if (dynamic_cast<SPText *>(*i) || - dynamic_cast<SPFlowtext *>(*i)) { + if (dynamic_cast<SPText *>(*i) || dynamic_cast<SPFlowtext *>(*i)) { SPItem *item = *i; - item->changeCSS(css,"style"); + + // Scale by inverse of accumulated paraent transform + SPCSSAttr *css_set = sp_repr_css_attr_new(); + sp_repr_css_merge(css_set, css); + Geom::Affine const local(item->i2doc_affine()); + double const ex(local.descrim()); + if ( (ex != 0.0) && (ex != 1.0) ) { + sp_css_attr_scale(css_set, 1/ex); + } + + item->changeCSS(css_set,"style"); + + sp_repr_css_attr_unref(css_set); } } } else { |
