summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlvin Penner <penner@vaxxine.com>2014-02-06 01:01:41 +0000
committerapenner <penner@vaxxine.com>2014-02-06 01:01:41 +0000
commitf08bd308b4c3a75bf770c01fb38cd02915d3aa19 (patch)
treedb8b14a30d358ab9694b0f2c45107cba8b19d187
parentDutch translation update (diff)
downloadinkscape-f08bd308b4c3a75bf770c01fb38cd02915d3aa19.tar.gz
inkscape-f08bd308b4c3a75bf770c01fb38cd02915d3aa19.zip
Extensions->Render submenu. Scaling of input parameters into document units, Part 1 (Bug 1240455)
Fixed bugs: - https://launchpad.net/bugs/1240455 (bzr r13001)
-rwxr-xr-xshare/extensions/draw_from_triangle.py10
-rwxr-xr-xshare/extensions/foldablebox.py2
-rwxr-xr-xshare/extensions/render_alphabetsoup.py2
-rw-r--r--share/extensions/render_gear_rack.py6
-rw-r--r--share/extensions/render_gears.py2
5 files changed, 12 insertions, 10 deletions
diff --git a/share/extensions/draw_from_triangle.py b/share/extensions/draw_from_triangle.py
index 414363e86..42cda7035 100755
--- a/share/extensions/draw_from_triangle.py
+++ b/share/extensions/draw_from_triangle.py
@@ -148,6 +148,8 @@ 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
@@ -190,17 +192,17 @@ class Style(object): #container for style information
def __init__(self, options):
#dot markers
self.d_rad = 4 #dot marker radius
- self.d_th = 2 #stroke width
+ self.d_th = Draw_From_Triangle.unittouu(e, '2px') #stroke width
self.d_fill= '#aaaaaa' #fill colour
self.d_col = '#000000' #stroke colour
#lines
- self.l_th = 2
+ self.l_th = Draw_From_Triangle.unittouu(e, '2px')
self.l_fill= 'none'
self.l_col = '#000000'
#circles
- self.c_th = 2
+ self.c_th = Draw_From_Triangle.unittouu(e, '2px')
self.c_fill= 'none'
self.c_col = '#000000'
@@ -314,7 +316,7 @@ class Draw_From_Triangle(inkex.Effect):
if len(pts) == 3: #if we have right number of nodes, else skip and end program
st = Style(so)#style for dots, lines and circles
-
+
#CREATE A GROUP TO HOLD ALL GENERATED ELEMENTS IN
#Hold relative to point A (pt[0])
group_translation = 'translate(' + str( pts[0][0] ) + ','+ str( pts[0][1] ) + ')'
diff --git a/share/extensions/foldablebox.py b/share/extensions/foldablebox.py
index 5d5945dd9..b504de89f 100755
--- a/share/extensions/foldablebox.py
+++ b/share/extensions/foldablebox.py
@@ -70,7 +70,7 @@ class FoldableBox(inkex.Effect):
box_id = self.uniqueId('box')
self.box = g = inkex.etree.SubElement(self.current_layer, 'g', {'id':box_id})
- line_style = simplestyle.formatStyle({ 'stroke': '#000000', 'fill': 'none' })
+ line_style = simplestyle.formatStyle({ 'stroke': '#000000', 'fill': 'none', 'stroke-width': str(self.unittouu('1px')) })
#self.createGuide( 0, docH, 0 );
diff --git a/share/extensions/render_alphabetsoup.py b/share/extensions/render_alphabetsoup.py
index ad43163e4..083f03af9 100755
--- a/share/extensions/render_alphabetsoup.py
+++ b/share/extensions/render_alphabetsoup.py
@@ -514,7 +514,7 @@ class AlphabetSoup(inkex.Effect):
help="Generate random (unreadable) text")
def effect(self):
- zoom = self.options.zoom
+ zoom = self.unittouu( str(self.options.zoom) + 'px')
if self.options.randomize:
imagelist = generate_random_string(self.options.text, zoom)
diff --git a/share/extensions/render_gear_rack.py b/share/extensions/render_gear_rack.py
index 13eaf1017..68c5d050e 100644
--- a/share/extensions/render_gear_rack.py
+++ b/share/extensions/render_gear_rack.py
@@ -65,8 +65,8 @@ class RackGear(inkex.Effect):
help="Contact Angle")
def effect(self):
- length = self.options.length
- spacing = self.options.spacing
+ length = self.unittouu(str(self.options.length) + 'px')
+ spacing = self.unittouu(str(self.options.spacing) + 'px')
angle = radians(self.options.angle)
# generate points: list of (x, y) pairs
@@ -93,7 +93,7 @@ class RackGear(inkex.Effect):
g = inkex.etree.SubElement(self.current_layer, 'g', g_attribs)
# Create SVG Path for gear
- style = {'stroke': '#000000', 'fill': 'none'}
+ style = {'stroke': '#000000', 'fill': 'none', 'stroke-width': str(self.unittouu('1px'))}
gear_attribs = {
'style': simplestyle.formatStyle(style),
'd': path}
diff --git a/share/extensions/render_gears.py b/share/extensions/render_gears.py
index 5201e553b..d5c8131a8 100644
--- a/share/extensions/render_gears.py
+++ b/share/extensions/render_gears.py
@@ -164,7 +164,7 @@ class Gears(inkex.Effect):
g = inkex.etree.SubElement(self.current_layer, 'g', g_attribs)
# Create SVG Path for gear
- style = { 'stroke': '#000000', 'fill': 'none' }
+ style = { 'stroke': '#000000', 'fill': 'none', 'stroke-width': str(self.unittouu('1px')) }
gear_attribs = {'style':simplestyle.formatStyle(style), 'd':path}
gear = inkex.etree.SubElement(g, inkex.addNS('path','svg'), gear_attribs )
if(centerdiameter > 0.0):