summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f60bb9f)
raw | patch | inline | side by side (parent: f60bb9f)
author | alvinpenner <alvinpenner@users.sourceforge.net> | |
Fri, 3 Jul 2009 11:10:14 +0000 (11:10 +0000) | ||
committer | alvinpenner <alvinpenner@users.sourceforge.net> | |
Fri, 3 Jul 2009 11:10:14 +0000 (11:10 +0000) |
share/extensions/hpgl_output.py | patch | blob | history |
index 7e2dbc8acc749fcc04e59ffe3ca04115cc466a3b..8c6eaa1684d6e1ecb26af9c1eb09e09ba5e90d42 100644 (file)
def output(self):
print ''.join(self.hpgl)
def effect(self):
- mirror = 1.0
- if self.options.mirror:
- mirror = -1.0
x0 = self.options.xOrigin
y0 = self.options.yOrigin
scale = 1016.0/90
+ mirror = 1.0
+ if self.options.mirror:
+ mirror = -1.0
+ if self.document.getroot().get('height'):
+ y0 -= float(self.document.getroot().get('height'))
i = 0
layerPath = '//svg:g[@inkscape:groupmode="layer"]'
for layer in self.document.getroot().xpath(layerPath, namespaces=inkex.NSS):
if first:
cmd = 'PU'
first = False
- self.hpgl.append('%s%d,%d;' % (cmd,(csp[1][0] - x0)*scale,(csp[1][1] - y0)*scale*mirror))
+ self.hpgl.append('%s%d,%d;' % (cmd,(csp[1][0] - x0)*scale,(csp[1][1]*mirror - y0)*scale))
if __name__ == '__main__': #pragma: no cover
e = MyEffect()