Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocate TextEdit's extra size on the side depending on the layout direction #5547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zakarumych
Copy link

TextEdit sometimes allocates extra space if text changes and no longer fits into previously allocated Rect.
It also can happen when rounding error occurs. In this case extra space is extra small.

If extra space is needed, Ui::allocate_rect is used to carve that space from placer.
However it always allocated extra space on the bottom-right from the rect placer returned initially.
This works well on Left-to-Right and Top-to-bottom layouts.
However in case it's Right-to-Left, Ui::allocate_rect updates placer's cursor and puts it to the right side of the initially allocated rect. And next widget is then placed over the TextEdit.

This is hard to notice usually.
However I have scaling that can cause rounding errors, so 0.0003 units of extra space is allocated each frame. Making next widget to overlap the TextEdit almost entirely.

This changes makes extra space allocation aware of the layout main direction and it picks most appropriate side of the widget for the extra space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTL layout breaks with TextEdit
1 participant