You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Right horizontal text alignment does not properly account for padding. Specifically, the "align_all_rows_right()" function of TextBoxLayout objects chooses as a starting point the width of its layout_rect. With nonzero padding, this effectively doubles the padding when aligning to the right. I think a more appropriate starting point would be layout_rect.right.
To Reproduce
Steps to reproduce the behaviour:
Create a UILabel element of fixed width and nonzero horizontal padding.
Compare the padding when the text of the element is aligned to the left vs the right. The padding is not equal.
Check label.drawable_shape.text_box_layout for underlying alignment behaviour.
Expected behaviour
Equal size padding with right and left alignment.
Screenshots
def align_right_all_rows(self, x_padding):
"""
Align all rows to the right hand side of the layout.
:param x_padding: the amount of padding to insert to on the right
before the text starts.
"""
start_right = self.layout_rect.width - x_padding # should change to self.layout_rect.right
for row in self.layout_rows:
row.align_right_row(start_right, self.floating_rects)
Platform and software (please complete the following information):
OS: Mac
Pygame GUI version: 6.9
The text was updated successfully, but these errors were encountered:
Describe the bug
Right horizontal text alignment does not properly account for padding. Specifically, the "align_all_rows_right()" function of TextBoxLayout objects chooses as a starting point the width of its layout_rect. With nonzero padding, this effectively doubles the padding when aligning to the right. I think a more appropriate starting point would be layout_rect.right.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Equal size padding with right and left alignment.
Screenshots
Platform and software (please complete the following information):
The text was updated successfully, but these errors were encountered: