Jumping grid when setting the origin to 0

Bug #1342238 reported by houz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
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.

Revision history for this message
houz (houz) wrote :
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
su_v (suv-lp) wrote :

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

Revision history for this message
Matthew Petroff (matthewpetroff) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.