-
Notifications
You must be signed in to change notification settings - Fork 11
Incorrect Dimensions with Non-Pixel User Unit #6
Copy link
Copy link
Open
Description
Just installed this extension on 0.92.3 and was getting some incorrect labels. I often make documents using inches with a scale of 1:1. With a test document w/ display units in inches and scale of 1, I made a reference 4in line. This yielded dimension of 0.0416666682292. Oddly this equals 4in/96px so I gathered the extension thought the document was still using pixel units.
I traced it down to this line of code I think:
inkscapeDimensions/dimensions.py
Line 659 in 897a76a
| value = self.userUnit2unit(value, unit) |
I also noticed that if the document scale is changed it will scale the labeled dimension. For example changing the scale from 1 to 2, a 4in line becomes 0.083.
FYI, this seems to fix things for me:
try:
elem = self.getElemFromXpath('/svg:svg/sodipodi:namedview')
doc_scale = self.getElemAtrib(elem, 'scale-x')
doc_scale = float(doc_scale)
except:
doc_scale = 1
value = self.unit2unit(value, self.documentUnit, unit) / doc_scaleReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels