Code

Printing marks update from Nicolas Dufour - changeing positions: star_target and...
authoraurium <aurium@users.sourceforge.net>
Wed, 4 Feb 2009 20:55:48 +0000 (20:55 +0000)
committeraurium <aurium@users.sourceforge.net>
Wed, 4 Feb 2009 20:55:48 +0000 (20:55 +0000)
share/extensions/printing-marks.inx
share/extensions/printing-marks.py

index d8455165bf5149926adaba201c305b52b37fa641..a893dedd6d7ff4d67c3a7cda149c67cc0cd0a650 100644 (file)
@@ -16,8 +16,8 @@
     </page>\r
     <page name="tab" _gui-text="Positioning">\r
       <param name="where" type="enum" _gui-text="Set crop marks to">\r
-        <item>selection</item>\r
-        <item>canvas</item>\r
+        <_item value="selection">Selection</_item>\r
+        <_item value="canvas">Canvas</_item>\r
       </param>\r
       <param name="unit" type="enum" _gui-text="Unit">\r
         <item>px</item>\r
index 0a8d54abba9ba92b653a11b2621690f550dcacae..710b71b1c7df5503ac0660d6166843dee81a7e95 100644 (file)
@@ -93,14 +93,16 @@ class Printing_Marks (inkex.Effect):
 \r
 \r
     def draw_crop_line(self, x1, y1, x2, y2, name, parent):\r
-        style = { 'stroke': '#000000', 'stroke-width': str(self.stroke_width), 'fill': 'none'}\r
+        style = { 'stroke': '#000000', 'stroke-width': str(self.stroke_width),\r
+                  'fill': 'none'}\r
         line_attribs = {'style': simplestyle.formatStyle(style),\r
                         'id': name,\r
                         'd': 'M '+str(x1)+','+str(y1)+' L '+str(x2)+','+str(y2)}\r
         inkex.etree.SubElement(parent, 'path', line_attribs)\r
 \r
     def draw_bleed_line(self, x1, y1, x2, y2, name, parent):\r
-        style = { 'stroke': '#000000', 'stroke-width': str(self.stroke_width), 'fill': 'none',\r
+        style = { 'stroke': '#000000', 'stroke-width': str(self.stroke_width),\r
+                  'fill': 'none',\r
                   'stroke-miterlimit': '4', 'stroke-dasharray': '4, 2, 1, 2',\r
                   'stroke-dashoffset': '0' }\r
         line_attribs = {'style': simplestyle.formatStyle(style),\r
@@ -156,7 +158,8 @@ class Printing_Marks (inkex.Effect):
                           inkex.addNS('label','inkscape'):name,\r
                           'transform':'translate('+str(cx)+','+str(cy)+')',\r
                           'd':d}\r
-        inkex.etree.SubElement(parent, inkex.addNS('path','svg'), regmark_attribs)\r
+        inkex.etree.SubElement(parent, inkex.addNS('path','svg'),\r
+                               regmark_attribs)\r
 \r
     def draw_coluor_bars(self, cx, cy, rotate, name, parent):\r
         g = inkex.etree.SubElement(parent, 'g', {\r
@@ -196,7 +199,8 @@ class Printing_Marks (inkex.Effect):
         self.height = height = inkex.unittouu(svg.attrib['height'])\r
 \r
         # Convert parameters to user unit\r
-        offset = inkex.unittouu(str(self.options.crop_offset) + self.options.unit)\r
+        offset = inkex.unittouu(str(self.options.crop_offset) + \\r
+                                self.options.unit)\r
         bt = inkex.unittouu(str(self.options.bleed_top)    + self.options.unit)\r
         bb = inkex.unittouu(str(self.options.bleed_bottom) + self.options.unit)\r
         bl = inkex.unittouu(str(self.options.bleed_left)   + self.options.unit)\r
@@ -328,13 +332,13 @@ class Printing_Marks (inkex.Effect):
 \r
             # Top Mark\r
             cy = max( bmt + offset, self.min_mark_margin )\r
-            self.draw_reg_marks((width/2) - self.mark_size*1.5,\r
+            self.draw_reg_marks((width/2),\r
                                 -cy - (self.mark_size/2),\r
                                 '90', 'regMarkT', g_center)\r
 \r
             # Bottom Mark\r
             cy = max( bmb + offset, self.min_mark_margin )\r
-            self.draw_reg_marks((width/2) - self.mark_size*1.5,\r
+            self.draw_reg_marks((width/2),\r
                                 height + cy + (self.mark_size/2),\r
                                 '-90', 'regMarkB', g_center)\r
 \r
@@ -359,12 +363,12 @@ class Printing_Marks (inkex.Effect):
             else :\r
                 # Top Star\r
                 cy = max( bmt + offset, self.min_mark_margin )\r
-                self.draw_star_target((width/2),\r
+                self.draw_star_target((width/2) - self.mark_size*1.5,\r
                                       -cy - (self.mark_size/2),\r
                                       'starTargetT', g_center)\r
                 # Bottom Star\r
                 cy = max( bmb + offset, self.min_mark_margin )\r
-                self.draw_star_target((width/2),\r
+                self.draw_star_target((width/2) - self.mark_size*1.5,\r
                                       height + cy + (self.mark_size/2),\r
                                       'starTargetB', g_center)\r
 \r