From a81a82dc4c5d46aec0a924287354356528bf6fb4 Mon Sep 17 00:00:00 2001 From: "Mohammed Y. Alnajdi" Date: Sun, 11 Oct 2020 08:49:57 +0300 Subject: [PATCH] Kozea/WeasyPrint#601: fix indentation --- weasyprint/layout/flex.py | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/weasyprint/layout/flex.py b/weasyprint/layout/flex.py index 717f99eee..7a6579321 100644 --- a/weasyprint/layout/flex.py +++ b/weasyprint/layout/flex.py @@ -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