unexpected/unwanted translate-x attribute (very small) when creating text or flowed text

Bug #1374614 reported by Alvin Penner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Alvin Penner

Bug Description

The unwanted translate attribute shows up in a <text> tag or a <flowroot> tag when creating these elements from scratch. The element has the same size typically, namely:
transform="translate(-7.3563764e-6,0)"

This appears to be numerical error in an x-coordinate which is very unusual, usually the y-coordinate is more problematic. The problem is that this transform element should not be present at all, it should not even exist. The size of the error appears to be related to page size and is apparently random.

Reproduced on Inkscape 13549,
with Preferences->Store Transformation->Optimized and flowed text, file attached

Revision history for this message
Alvin Penner (apenner) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

Reproduced on Inkscape 13549,
with Preferences->Store Transformation->Preserved with both normal text and flowed text, file attached

not reproduced on Inkscape 0.48.5

su_v (suv-lp)
tags: added: precision regression text transformations
Changed in inkscape:
milestone: none → 0.91
Revision history for this message
su_v (suv-lp) wrote :

On 2014-09-26 21:44 , Alvin Penner wrote:
> with Preferences->Store Transformation->Preserved with both normal
> text and flowed text, file attached

Note that with preserved transforms, AFAICT this happens with any object type, not just <text> (regular or flowed).

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

On OS X 10.7.5,
- not reproduced with Inkscape 0.48.5 r10042
- reproduced with 0.91pre2 r13564

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

(Possibly related: imprecise snapping to guides, grid and page borders in bug #1373311, bug #1235279)

Revision history for this message
Alvin Penner (apenner) wrote :

attached is a proposed patch for this bug.

in the file viewbox.cpp, in the routine SPViewBox::apply_viewbox, the incoming data (in.width() and in.height()) are originally of type SVGLength.computed, which is a single-precision float variable. Therefore there is no point in comparing them to double precision variables like 'this->viewBox.width()'. This will just lead to spurious errors, of the type seen here. Therefore I degraded the comparisons to be all float data.
 This fixes the immediate bug reported here. I am not sure what the consequences will be for other routines that use this same function, and I'm not sure if this is the most elegant way of doing this, so I thought I'd post the proposal here for comment. If there are no serious objections within the next four days or so, then I'll commit it.

Revision history for this message
Alvin Penner (apenner) wrote :

attached is an improved version of the patch. This version attempts to deal with Bug 1235279 as well as the current bug.

Revision history for this message
Alvin Penner (apenner) wrote :

fix committed to rev 13581

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp)
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → 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.