diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-09-07 19:26:35 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-09-07 21:48:33 +0000 |
| commit | aebf8e855097a4c2a7f11455596885f1633e3b1f (patch) | |
| tree | 0e0ed893c634e5788c3630ed9fc208d31d1a5a9e /src/ui/toolbar/text-toolbar.cpp | |
| parent | Allow transforms in SVG2 flow elements (diff) | |
| download | inkscape-aebf8e855097a4c2a7f11455596885f1633e3b1f.tar.gz inkscape-aebf8e855097a4c2a7f11455596885f1633e3b1f.zip | |
Fix bugs appliing in fallback elements
Diffstat (limited to 'src/ui/toolbar/text-toolbar.cpp')
| -rw-r--r-- | src/ui/toolbar/text-toolbar.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp index 40067e960..90b9ebe90 100644 --- a/src/ui/toolbar/text-toolbar.cpp +++ b/src/ui/toolbar/text-toolbar.cpp @@ -1318,6 +1318,7 @@ TextToolbar::lineheight_value_changed() sp_repr_css_attr_unref(cssfit); } // Only need to save for undo if a text item has been changed. + itemlist= selection->items(); bool modmade = false; for (auto i : itemlist) { SPText *text = dynamic_cast<SPText *>(i); @@ -1526,7 +1527,7 @@ TextToolbar::lineheight_unit_changed(int /* Not Used */) subselection_wrap_toggle(false); sp_repr_css_attr_unref(cssfit); } - + itemlist= selection->items(); // Only need to save for undo if a text item has been changed. bool modmade = false; for (auto i : itemlist) { @@ -1949,7 +1950,7 @@ void TextToolbar::selection_changed(Inkscape::Selection *selection) // don't bot int unit = prefs->getInt("/options/font/unitType", SP_CSS_UNIT_PT); double size = 0; if (!size && _cusor_numbers != QUERY_STYLE_NOTHING) { - size = sp_style_css_size_px_to_units(query_cursor.font_size.computed, unit); + size = sp_style_css_size_px_to_units(_query_cursor.font_size.computed, unit); } if (!size && result_numbers != QUERY_STYLE_NOTHING) { size = sp_style_css_size_px_to_units(query.font_size.computed, unit); @@ -2032,6 +2033,12 @@ void TextToolbar::selection_changed(Inkscape::Selection *selection) // don't bot height = query_fallback.line_height.value; line_height_unit = query_fallback.line_height.unit; } + + if (!height && _cusor_numbers != QUERY_STYLE_NOTHING) { + height = _query_cursor.line_height.value; + line_height_unit = _query_cursor.line_height.unit; + } + if (line_height_unit == SP_CSS_UNIT_PERCENT) { height *= 100.0; // Inkscape store % as fraction in .value } @@ -2431,7 +2438,7 @@ void TextToolbar::subselection_changed(gpointer texttool) //TODO: find a better way to init _updating = true; SPStyle query(SP_ACTIVE_DOCUMENT); - query_cursor = query; + _query_cursor = query; Inkscape::Text::Layout::iterator start_line = tc->text_sel_start; start_line.thisStartOfLine(); if (tc->text_sel_start == start_line) { @@ -2439,7 +2446,7 @@ void TextToolbar::subselection_changed(gpointer texttool) } else { tc->text_sel_start = prev; } - _cusor_numbers = sp_desktop_query_style(SP_ACTIVE_DESKTOP, &query_cursor, QUERY_STYLE_PROPERTY_FONTNUMBERS); + _cusor_numbers = sp_desktop_query_style(SP_ACTIVE_DESKTOP, &_query_cursor, QUERY_STYLE_PROPERTY_FONTNUMBERS); tc->text_sel_start = start_selection; _updating = false; break; |
