Skip to content
Prev Previous commit
Next Next commit
Change alignment to absolute on paragraph
  • Loading branch information
jtrain committed May 1, 2017
commit af65204cb2d2d96863418099032447cff85582a1
12 changes: 6 additions & 6 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 = positionV

if margin is not None:
anchor.distT = margin.get('top', 0)
anchor.distR = margin.get('right', 0)
anchor.distB = margin.get('bottom', 0)
anchor.distL = margin.get('left', 0)
anchor.set('distT', margin.get('top', 0))
anchor.set('distR', margin.get('right', 0))
anchor.set('distB', margin.get('bottom', 0))
anchor.set('distL', margin.get('left', 0))

if wrap is not None:
anchor.wrapSquare.set('wrapText', wrap)
Expand All @@ -162,8 +162,8 @@ def _inline_xml(cls):
' <wp:positionH relativeFrom="margin">\n'
' <wp:align>right</wp:align>\n'
' </wp:positionH>\n'
' <wp:positionV relativeFrom="margin">\n'
' <wp:align>center</wp:align>\n'
' <wp:positionV relativeFrom="paragraph">\n'
' <wp:posOffset>3810</wp:posOffset>\n'
' </wp:positionV>\n'
' <wp:extent cx="914400" cy="914400"/>\n'
' <wp:effectExtent l="0" t="0" r="0" b="0" />\n'
Expand Down