summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2014-02-18 00:09:33 +0000
committerapenner <penner@vaxxine.com>2014-02-18 00:09:33 +0000
commitf215be301a4224ff7cd5f1c9233932d8efc1ee04 (patch)
treea1a4a148745c5817527b64251827eb97098925d2 /share
parentscaling of viewBox on document unit change (Bug 1236257) (diff)
downloadinkscape-f215be301a4224ff7cd5f1c9233932d8efc1ee04.tar.gz
inkscape-f215be301a4224ff7cd5f1c9233932d8efc1ee04.zip
Extensions. Measure Path. Scaling of area and length into document units. (Bug 1240455)
(bzr r13035)
Diffstat (limited to 'share')
-rwxr-xr-xshare/extensions/measure.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/extensions/measure.py b/share/extensions/measure.py
index 68cce0334..ca471816f 100755
--- a/share/extensions/measure.py
+++ b/share/extensions/measure.py
@@ -121,7 +121,7 @@ class Length(inkex.Effect):
self.OptionParser.add_option("-s", "--scale",
action="store", type="float",
dest="scale", default=1,
- help="The distance above the curve")
+ help="Scale Factor (Drawing:Real Length)")
self.OptionParser.add_option("-r", "--orient",
action="store", type="inkbool",
dest="orient", default=True,
@@ -138,6 +138,7 @@ class Length(inkex.Effect):
def effect(self):
# get number of digits
prec = int(self.options.precision)
+ self.options.offset *= self.unittouu('1px')
factor = 1.0
doc = self.document.getroot()
if doc.get('viewBox'):
@@ -154,7 +155,7 @@ class Length(inkex.Effect):
mat = simpletransform.composeParents(node, [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])
p = cubicsuperpath.parsePath(node.get('d'))
simpletransform.applyTransformToPath(mat, p)
- factor = factor/self.unittouu('1'+self.options.unit)
+ factor *= self.unittouu('1px')/self.unittouu('1'+self.options.unit)
if self.options.type == "length":
slengths, stotal = csplength(p)
else: