diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-03-30 17:26:19 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-03-30 17:26:19 +0000 |
| commit | a18efaedfcc01ec5bd1b9c60ca55b8be4445c5cb (patch) | |
| tree | c00e91922f73997e61405afb28c893f51a31845e /src/widgets/text-toolbar.cpp | |
| parent | Fix for bug #1395435 (Inkscape crashes on load CDR select sheet) and bug #144... (diff) | |
| download | inkscape-a18efaedfcc01ec5bd1b9c60ca55b8be4445c5cb.tar.gz inkscape-a18efaedfcc01ec5bd1b9c60ca55b8be4445c5cb.zip | |
Partial fix for bug 156221 ('line-height' with non-pixel scaled drawing).
(bzr r14752)
Diffstat (limited to 'src/widgets/text-toolbar.cpp')
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 8df80d2b6..e71c911bd 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -638,7 +638,8 @@ static void sp_text_lineheight_unit_changed( gpointer /* */, GObject *tbl ) int count = 0; for(std::vector<SPItem*>::const_iterator i=itemlist.begin();i!=itemlist.end(); ++i){ if (SP_IS_TEXT (*i)) { - font_size += (*i)->style->font_size.computed; + double doc_scale = Geom::Affine((*i)->i2dt_affine()).descrim(); + font_size += (*i)->style->font_size.computed * doc_scale; ++count; } } @@ -662,7 +663,8 @@ static void sp_text_lineheight_unit_changed( gpointer /* */, GObject *tbl ) int count = 0; for(std::vector<SPItem*>::const_iterator i=itemlist.begin();i!=itemlist.end(); ++i){ if (SP_IS_TEXT (*i)) { - font_size += (*i)->style->font_size.computed; + double doc_scale = Geom::Affine((*i)->i2dt_affine()).descrim(); + font_size += (*i)->style->font_size.computed * doc_scale; ++count; } } @@ -671,12 +673,13 @@ static void sp_text_lineheight_unit_changed( gpointer /* */, GObject *tbl ) } else { font_size = 20; } - line_height *= font_size; + if (old_unit == SP_CSS_UNIT_PERCENT) { line_height /= 100.0; } else if (old_unit == SP_CSS_UNIT_EX) { line_height /= 2.0; } + line_height *= font_size; line_height = Quantity::convert(line_height, "px", unit); } else { // Convert between different absolute units (only used in GUI) @@ -1252,7 +1255,6 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/ double height; int line_height_unit = -1; if (query.line_height.normal) { - std::cout << " normal" << std::endl; height = Inkscape::Text::Layout::LINE_HEIGHT_NORMAL; line_height_unit = SP_CSS_UNIT_NONE; } else { |
