Grid parameters not working with comma as decimal separator

Bug #1216306 reported by neclepsio on 2013-08-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Matthew Petroff

Bug Description

Using version 0.48+devel r12484 on Ubuntu (English but with Italian regional settings), when I enter "0,1", which is Italian form for "0.1" in grid spacing field I get the grid as if I entered "1". Using the buttons or entering "0.1" does not work either, because the number gets automatically (and correctly) converted to "0,1".

Thank you.
Ignazio

jazzynico (jazzynico) wrote :

Does it affect the grids parameters or all the numeric fields?
Does the numeric part of your keyboard have a comma or a period? If so, it could be related or duplicate of Bug #263111 "Decimal numbers - accept comma on Numeric Keyboard" <https://bugs.launchpad.net/inkscape/+bug/263111>.

Changed in inkscape:
status: New → Incomplete
tags: added: ui
neclepsio (neclepsio) wrote :

No, it is not duplicated of 263111 because I'm not using the numeric pad.
The problem only affects the grid spacing: all the other numeric fields I tried work as intended.

Thank you

jazzynico (jazzynico) wrote :

Forgot to ask: is the grid you mention the one from the Document properties or the one from the extensions (Render>Grids>Grid...)?

I've tried to reproduced the bug with both, but I see no issue on Windows XP, Inkscape trunk revision 12485.

Changed in inkscape:
status: Incomplete → New

It's with document properties. Maybe the bug is Linux specific.

On Sun, Aug 25, 2013 at 1:47 PM, JazzyNico <email address hidden>wrote:

> Forgot to ask: is the grid you mention the one from the Document
> properties or the one from the extensions (Render>Grids>Grid...)?
>
> I've tried to reproduced the bug with both, but I see no issue on
> Windows XP, Inkscape trunk revision 12485.
>
> ** Changed in: inkscape
> Status: Incomplete => New
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1216306
>
> Title:
> Grid parameters not working with comma as decimal separator
>
> Status in Inkscape: A Vector Drawing Tool:
> New
>
> Bug description:
> Using version 0.48+devel r12484 on Ubuntu (English but with Italian
> regional settings), when I enter "0,1", which is Italian form for
> "0.1" in grid spacing field I get the grid as if I entered "1". Using
> the buttons or entering "0.1" does not work either, because the
> number gets automatically (and correctly) converted to "0,1".
>
> Thank you.
> Ignazio
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1216306/+subscriptions
>

neclepsio (neclepsio) wrote :

It's with document properties. Maybe the bug is Linux specific.

su_v (suv-lp) wrote :

On OS X 10.7.5:
- not reproduced with r12470
- reproduced with r12471 and later revisions

Likely yet another regression introduced with latest unit refactoring in r12471:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12471>

Test case used:
- offset grid by half a pixel (useful to have pixelgrid-aligned stroked paths)
Environment setup: default locale "en_US.UTF-8", inkscape launched with this command:
$ LC_NUMERIC="it_IT.UTF-8" inkscape

AFAICT it affects offset of origin as well as grid spacing.

tags: added: grids regression units
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.49
status: New → Confirmed
su_v (suv-lp) wrote :

Not only affects modifying grid options via UI, but also rendering files having such offset grids, if based on the locale settings the komma ',' is used as decimal separator, and the values for certain aspects of the grid are smaller than 1.

Does not affect locale settings with '.' as decimal separator.

su_v (suv-lp) wrote :

Screenshots of the same file (originally created with en_US.UTF-8 locale settings), reopened with:
1) '.' as decimal separator
2) ',' as decimal separator

Fixed in r12498.

Changed in inkscape:
assignee: nobody → Matthew Petroff (matthewpetroff)
status: Confirmed → Fix Released
Krzysztof Kosinski (tweenk) wrote :

This is not fixed. The entry field accepts the comma, but the incorrect localized value is still emitted to the SVG file. Use g_ascii_dtostr.

Changed in inkscape:
status: Fix Released → Confirmed

@Krzysztof I'm not sure what you mean. My guess is commas instead of periods being written to the SVG file, but I am not able to reproduce that behavior on my end.

Krzysztof Kosinski (tweenk) wrote :

Yes, I meant commas written to the SVG file.

If the SVG file always contains dots regardless of locale, then the bug can be considered fixed.

The regex match is converted to a double by the locale aware std::istringstream function. The output is written by the standard Inkscape SVG functions just like everything else, so the output contains dots regardless of locale. The only thing that needed to be fixed was changing the regex to accept commas.

Changed in inkscape:
status: Confirmed → Fix Released
su_v (suv-lp) on 2013-09-19
Changed in inkscape:
milestone: 0.49 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers