Skip to content

Commit

Permalink
#601: fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
malnajdi committed Oct 11, 2020
1 parent 0c2e7b2 commit a81a82d
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions weasyprint/layout/flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,32 +651,32 @@ def flex_layout(context, box, max_position_y, skip_stack, containing_block,

if (box.style['direction'] == 'rtl' and
box.style['flex_direction'].startswith('row')):
if justify_content == 'flex-end':
position_axis -= free_space
elif justify_content == 'center':
position_axis -= free_space / 2
elif justify_content == 'space-around':
position_axis -= free_space / len(line) / 2
if justify_content == 'flex-end':
position_axis -= free_space
elif justify_content == 'center':
position_axis -= free_space / 2
elif justify_content == 'space-around':
position_axis -= free_space / len(line) / 2
elif justify_content == 'space-evenly':
position_axis -= free_space / (len(line) - 1)

for i, child in line:
if axis == 'width':
child.position_x = position_axis
if justify_content == 'stretch':
child.width -= free_space / len(line)
else:
child.position_y = position_axis
position_axis -= (
child.margin_width() if axis == 'width'
else child.margin_height())
if justify_content == 'space-around':
position_axis -= free_space / len(line)
elif justify_content == 'space-between':
if len(line) > 1:
position_axis -= free_space / (len(line) + 1)
elif justify_content == 'space-evenly':
position_axis -= free_space / (len(line) - 1)

for i, child in line:
if axis == 'width':
child.position_x = position_axis
if justify_content == 'stretch':
child.width -= free_space / len(line)
else:
child.position_y = position_axis
position_axis -= (
child.margin_width() if axis == 'width'
else child.margin_height())
if justify_content == 'space-around':
position_axis -= free_space / len(line)
elif justify_content == 'space-between':
if len(line) > 1:
position_axis -= free_space / (len(line) + 1)
elif justify_content == 'space-evenly':
position_axis -= free_space / (len(line) - 1)
else:
if justify_content == 'flex-end':
position_axis += free_space
Expand Down

0 comments on commit a81a82d

Please sign in to comment.