fix in shirt waiste

This commit is contained in:
Mario Voigt 2020-08-23 01:58:34 +02:00
parent 8621d58047
commit aa36cdea27

View File

@ -61,7 +61,7 @@ class ShirtWaistAllington(inkex.Effect):
def printPoint(pnt): def printPoint(pnt):
debug(' %s = %f, %f')%pnt.id, pnt.x, pnt.y debug(' %s = %f, %f')%pnt.id, pnt.x, pnt.y
INCH_to_PX = 90.0 #inkscape uses 90 pixels per 1 inch INCH_to_PX = 96.0 #inkscape 1.0 uses 96 pixels per 1 inch
CM_to_INCH = 1/2.54 CM_to_INCH = 1/2.54
CM_to_PX = CM_to_INCH*INCH_to_PX CM_to_PX = CM_to_INCH*INCH_to_PX
CM = CM_to_PX # CM - shorthand when using centimeters CM = CM_to_PX # CM - shorthand when using centimeters
@ -442,9 +442,11 @@ class ShirtWaistAllington(inkex.Effect):
#resize document to fit pattern piece layout #resize document to fit pattern piece layout
width = ddx+d2.x # use pattern piece that appears farthest to the right in Inkscape canvas width = ddx+d2.x # use pattern piece that appears farthest to the right in Inkscape canvas
doc_width = width+2*SEAM_ALLOWANCE+2*BORDER doc_width = width+2*SEAM_ALLOWANCE+2*BORDER
doc.set('width', str(doc_width))
doc_height = row_offset+SEAM_ALLOWANCE+BORDER doc_height = row_offset+SEAM_ALLOWANCE+BORDER
doc.set('height', str(doc_height)) root = self.svg.getElement('//svg:svg');
root.set('viewBox', '%f %f %f %f' % (0,0,doc_width,doc_height))
root.set('width', str(doc_width))
root.set('height', str(doc_height))
#Place notes on document after pattern pieces are transformed so that notes are centered on correct width #Place notes on document after pattern pieces are transformed so that notes are centered on correct width
x = doc_width/2.0 x = doc_width/2.0
@ -454,5 +456,4 @@ class ShirtWaistAllington(inkex.Effect):
addText(bodice, 'note'+str(i), x, y, item, fontsize = '28', textalign = 'center', textanchor = 'middle', reference = 'false') addText(bodice, 'note'+str(i), x, y, item, fontsize = '28', textalign = 'center', textanchor = 'middle', reference = 'false')
y = y+0.33*IN y = y+0.33*IN
effect = ShirtWaistAllington() ShirtWaistAllington().run()
effect.run()