Skip to content
Prev Previous commit
Next Next commit
Margins should be ints not floats
  • Loading branch information
jtrain committed May 2, 2017
commit 6bff61938e14d94da4dd2c01b0716f1b78571640
8 changes: 4 additions & 4 deletions docx/oxml/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def new(cls, cx, cy, shape_id, pic, position, margin=None, wrap=None):
anchor.positionV.getchildren()[0].text = unicode(positionV)

if margin is not None:
anchor.set('distT', unicode(margin.get('top', 0)))
anchor.set('distR', unicode(margin.get('right', 0)))
anchor.set('distB', unicode(margin.get('bottom', 0)))
anchor.set('distL', unicode(margin.get('left', 0)))
anchor.set('distT', u"%d" % margin.get('top', 0))
anchor.set('distR', u"%d" % margin.get('right', 0))
anchor.set('distB', u"%d" % margin.get('bottom', 0))
anchor.set('distL', u"%d" % margin.get('left', 0))

if wrap is not None:
anchor.wrapSquare.set('wrapText', wrap)
Expand Down