diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-08-31 18:08:08 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-09-07 21:48:33 +0000 |
| commit | 6ea4142a7c43d62bae7971bece0201ae7028d2d9 (patch) | |
| tree | 2c4580ef43aec863ab4b2317427edc9003d9ecd9 /src/ui/toolbar/text-toolbar.cpp | |
| parent | Last improvements to line height (diff) | |
| download | inkscape-6ea4142a7c43d62bae7971bece0201ae7028d2d9.tar.gz inkscape-6ea4142a7c43d62bae7971bece0201ae7028d2d9.zip | |
fix cursor font size
Diffstat (limited to 'src/ui/toolbar/text-toolbar.cpp')
| -rw-r--r-- | src/ui/toolbar/text-toolbar.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp index b4ea38caf..e334a7dbd 100644 --- a/src/ui/toolbar/text-toolbar.cpp +++ b/src/ui/toolbar/text-toolbar.cpp @@ -2229,20 +2229,22 @@ void TextToolbar::subselection_changed(gpointer texttool) SPItem *item = dynamic_cast<SPItem *>(child); if (counter == startline) { this->_sub_active_item = item; - int origin_selection = layout->iteratorToCharIndex(tc->text_sel_start); + int origin_selection = layout->iteratorToCharIndex(start_selection); Inkscape::Text::Layout::iterator next = layout->charIndexToIterator(origin_selection + 1); Inkscape::Text::Layout::iterator prev = layout->charIndexToIterator(origin_selection - 1); //TODO: find a better way to init _updating = true; SPStyle query(SP_ACTIVE_DOCUMENT); query_cursor = query; - if (end_selection.nextStartOfSpan()) { - tc->text_sel_start = prev; - } else { + Inkscape::Text::Layout::iterator start_line = tc->text_sel_start; + start_line.thisStartOfLine(); + if (tc->text_sel_start == start_line) { tc->text_sel_start = next; + } else { + tc->text_sel_start = prev; } _cusor_numbers = sp_desktop_query_style(SP_ACTIVE_DESKTOP, &query_cursor, QUERY_STYLE_PROPERTY_FONTNUMBERS); - tc->text_sel_start = layout->charIndexToIterator(origin_selection); + tc->text_sel_start = start_selection; _updating = false; break; } |
