diff options
| author | Ted Gould <ted@gould.cx> | 2016-07-27 15:50:24 +0000 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2016-07-27 15:50:24 +0000 |
| commit | e0564a4174331f32970bd28695fae5732420accc (patch) | |
| tree | c6b4c430d785bd83f7a930ce4b2c17d6c5a68980 /share/extensions | |
| parent | Add build dependencies (diff) | |
| parent | Revert the canvas widget changes, which cause performance regressions (diff) | |
| download | inkscape-e0564a4174331f32970bd28695fae5732420accc.tar.gz inkscape-e0564a4174331f32970bd28695fae5732420accc.zip | |
Merge 0.92.x branch
(bzr r14950.1.12)
Diffstat (limited to 'share/extensions')
| -rwxr-xr-x | share/extensions/draw_from_triangle.py | 14 | ||||
| -rw-r--r-- | share/extensions/restack.inx | 4 | ||||
| -rwxr-xr-x | share/extensions/svg_and_media_zip_output.py | 2 | ||||
| -rw-r--r-- | share/extensions/ungroup_deep.py | 10 |
4 files changed, 15 insertions, 15 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/restack.inx b/share/extensions/restack.inx index 4f5f577cb..e14d2d5d5 100644 --- a/share/extensions/restack.inx +++ b/share/extensions/restack.inx @@ -9,7 +9,7 @@ <_param name="desc_dir" type="description" appearance="header">Restack Direction</_param> <param name="nb_direction" type="notebook"> <page name="presets" _gui-text="Presets"> - <param name="direction" type="enum" _gui-text=""> + <param name="direction" type="enum" gui-text=""> <_item value="lr">Left to Right (0)</_item> <_item value="bt">Bottom to Top (90)</_item> <_item value="rl">Right to Left (180)</_item> @@ -36,7 +36,7 @@ </page> <page name="z_order" _gui-text="Based on Z-Order"> <_param name="desc_zsort" type="description" appearance="header">Restack Mode</_param> - <param name="zsort" type="enum" _gui-text=""> + <param name="zsort" type="enum" gui-text=""> <_item value="rev">Reverse Z-Order</_item> <_item value="rand">Shuffle Z-Order</_item> </param> diff --git a/share/extensions/svg_and_media_zip_output.py b/share/extensions/svg_and_media_zip_output.py index fb1ddd823..e021bfd4e 100755 --- a/share/extensions/svg_and_media_zip_output.py +++ b/share/extensions/svg_and_media_zip_output.py @@ -111,7 +111,7 @@ class CompressedMediaOutput(inkex.Effect): url = urlparse.urlparse(xlink) href = urllib.url2pathname(url.path) - if (href != None): + if (href != None and os.path.isfile(href)): absref = os.path.realpath(href) absref = unicode(absref, "utf-8") 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 |
