Inkscape: A Vector Drawing Tool

Bad input logic in Spacing between lines combo box

Reported by Yevgeny Lezhnin on 2012-03-28
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Low
Yevgeny Lezhnin

Bug Description

There are 2 combo box for setting text spacing between lines: one in toolbox and one in the Text and Font dialog.
The one in toolbox works fine, but it ignores '%' symbol.
The one in the dialog has a problem: then trying to set a real number text, text spacing becomes normal, but combo box contents becomes a garbage. For example: if I set 1.5 spacing, combo box contents becomes "4%".

Changed in inkscape:
assignee: nobody → Yevgeny Lezhnin (z-lezhnin)
Changed in inkscape:
status: New → In Progress
Yevgeny Lezhnin (z-lezhnin) wrote :

I replace text, then there is no '%' symbol to "{number*100}%"

Changed in inkscape:
status: In Progress → Fix Committed
~suv (suv-lp) wrote :

<off-topic>
Reverting bug status to 'In Progress': 'Fix committed' in the bug tracker refers to changes actually committed to current trunk (or the stable branch), not to patches attached to bug reports.

See also
<http://wiki.inkscape.org/wiki/index.php/Bug_management#Bug_status>
</off-topic>

Changed in inkscape:
status: Fix Committed → In Progress
Changed in inkscape:
status: In Progress → New
jazzynico (jazzynico) wrote :

Thanks for your patch, Yevgeny.

Tested on Windows XP, Inkscape revision 11141.
Works almost as expected. Two issues regarding the T&F dialog:
1. Rounding errors (2.1 gives 209%).
2. The box doesn't convert the point decimal mark to a localized decimal separator. If the local separator is a coma and I use a point, the right part is not taken into account (1.96 gives 100%).

Maybe point 2 is out of the scope of your patch, but since the toolbox entries correctly convert to localized values, it would be great to have it here too.

Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.49
status: New → In Progress
Yevgeny Lezhnin (z-lezhnin) wrote :

I make some universal solution for second issue using strtod() function, also I use floor() function to fix rounding errors. Maybe it is better to use some round function, but I don't know is there any crossplatform variant. Also I folowed Tav advice about c++ strings, now I use c++ string's find() function.

jazzynico (jazzynico) wrote :

The rounding fix looks good.

As for the localization issue, I'd rather fix it by reusing a widget that supports it, instead of adding specific code here. UI::Widget::Scalar and UI::Widget::ScalarUnit may be good candidates (usage example in ui/dialog/transformation.cpp).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers