summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-06-23 08:44:27 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-06-23 08:44:27 +0000
commitcdff078c3050401ebf89661e4491073b8f9746cc (patch)
treea17f2e17c65a76a250fc56a6437715276ceee5f7 /share/extensions
parentMerge changes from trunk (diff)
parent[Bug #1594542] Reset paint buckets parameters icon is not visible in Tool Con... (diff)
downloadinkscape-cdff078c3050401ebf89661e4491073b8f9746cc.tar.gz
inkscape-cdff078c3050401ebf89661e4491073b8f9746cc.zip
Merge changes from trunk
(bzr r14949.1.26)
Diffstat (limited to 'share/extensions')
-rwxr-xr-xshare/extensions/draw_from_triangle.py14
-rw-r--r--share/extensions/ungroup_deep.py10
2 files changed, 12 insertions, 12 deletions
diff --git a/share/extensions/draw_from_triangle.py b/share/extensions/draw_from_triangle.py
index 74a58b863..3146fe26e 100755
--- a/share/extensions/draw_from_triangle.py
+++ b/share/extensions/draw_from_triangle.py
@@ -147,8 +147,6 @@ def get_n_points_from_path( node, n):#returns a list of first n points (x,y) in
if len(xi) == n and len(yi) == n:
points = [] # returned pairs of points
for i in range(n):
- xi[i] = Draw_From_Triangle.unittouu(e, str(xi[i]) + 'px')
- yi[i] = Draw_From_Triangle.unittouu(e, str(yi[i]) + 'px')
points.append( [ xi[i], yi[i] ] )
else:
#inkex.errormsg(_('Error: Not enough nodes to gather coordinates.')) #fail silently and exit, rather than invoke an error console
@@ -176,21 +174,23 @@ def cot(x):#cotangent(x)
return 1/tan(x)
def report_properties( params ):#report to the Inkscape console using errormsg
- inkex.errormsg(_("Side Length 'a' (px): " + str( params[0][0] ) ))
- inkex.errormsg(_("Side Length 'b' (px): " + str( params[0][1] ) ))
- inkex.errormsg(_("Side Length 'c' (px): " + str( params[0][2] ) ))
+ # TODO: unit identifier needs solution for arbitrary document scale
+ unit = Draw_From_Triangle.getDocumentUnit(e)
+ inkex.errormsg(_("Side Length 'a' (" + unit + "): " + str( params[0][0] ) ))
+ inkex.errormsg(_("Side Length 'b' (" + unit + "): " + str( params[0][1] ) ))
+ inkex.errormsg(_("Side Length 'c' (" + unit + "): " + str( params[0][2] ) ))
inkex.errormsg(_("Angle 'A' (radians): " + str( params[1][0] ) ))
inkex.errormsg(_("Angle 'B' (radians): " + str( params[1][1] ) ))
inkex.errormsg(_("Angle 'C' (radians): " + str( params[1][2] ) ))
inkex.errormsg(_("Semiperimeter (px): " + str( params[4][1] ) ))
- inkex.errormsg(_("Area (px^2): " + str( params[4][0] ) ))
+ inkex.errormsg(_("Area ("+ unit + "^2): " + str( params[4][0] ) ))
return
class Style(object): #container for style information
def __init__(self, options):
#dot markers
- self.d_rad = 4 #dot marker radius
+ self.d_rad = Draw_From_Triangle.unittouu(e, '4px') #dot marker radius
self.d_th = Draw_From_Triangle.unittouu(e, '2px') #stroke width
self.d_fill= '#aaaaaa' #fill colour
self.d_col = '#000000' #stroke colour
diff --git a/share/extensions/ungroup_deep.py b/share/extensions/ungroup_deep.py
index d27bb8a69..359232007 100644
--- a/share/extensions/ungroup_deep.py
+++ b/share/extensions/ungroup_deep.py
@@ -63,17 +63,17 @@ class Ungroup(inkex.Effect):
elif s[-2:] == "px":
return float(s[:-2])
elif s[-2:] == "pt":
- return float(s[:-2]) * 1.25
+ return float(s[:-2]) * 1.33
elif s[-2:] == "em":
return float(s[:-2]) * 16
elif s[-2:] == "mm":
- return float(s[:-2]) * 3.54
+ return float(s[:-2]) * 3.779
elif s[-2:] == "pc":
- return float(s[:-2]) * 15
+ return float(s[:-2]) * 16
elif s[-2:] == "cm":
- return float(s[:-2]) * 35.43
+ return float(s[:-2]) * 37.79
elif s[-2:] == "in":
- return float(s[:-2]) * 90
+ return float(s[:-2]) * 96
else:
return 1024