Jumping grid when setting the origin to 0

Bug #1342238 reported by houz on 2014-07-15
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Matthew Petroff

Bug Description

With current trunk (r13453) I have trouble setting the origin of a grid to 0 using the spinbuttons (or the mouse wheel). For some reason the grid jumps to a non-related position when the value in the document properties is 0 while it displays correctly for other values. When entering the 0 by hand everything works as expected.

I attached a short video of me doing the steps and showing the bug. Note that https://bugs.launchpad.net/inkscape/+bug/561503 can be seen in the video, too.

houz (houz) wrote :
su_v (suv-lp) wrote :

Reproduced with r13452 on OS X 10.7.5

tags: added: grids ui
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.91
status: New → Confirmed
tags: added: regression
Alvin Penner (apenner) wrote :

the error is occurring in the file util\units.cpp, in the routine:
Quantity UnitTable::parseQuantity(Glib::ustring const &q) const

This routine is parsing data like 0.1mm and splitting them into units and values. If it receives an extremely small floating point number then the parsing fails.

Attached are two cases, the incoming string is 'q', the numerical value is 'value', the units are 'abbr', and the value of the final outgoing result is 'qty.value':

q = -0.1mm
value = -0.100000
abbr = mm
qty.value("px") = -0.354331

q = 2.7755576e-017mm
value = 0.000000
abbr = e
qty.value("px") = -1.000000

The first conversion works, the second one fails because the units have been misinterpreted as 'e', which is not a valid unit.

I would suggest contacting Matthew Petroff, since he is the author.

su_v (suv-lp) wrote :

@Matthew - any chance you could comment on this bug?

Alvin is correct. The function he mentions does interpret "e" as the unit. I need to change it such that the value, detected by the first regular expression, is removed from the string before the regular expression that extracts the unit is run. I'm away from my build machine for about the next three weeks but should be able to fix it once I get back.

Changed in inkscape:
assignee: nobody → Matthew Petroff (matthewpetroff)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers