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

Fix Popup hover and height calculation are off by some pixels #86141

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

Maran23
Copy link
Contributor

@Maran23 Maran23 commented Dec 14, 2023

Fixes: #86140

This was caused by an incorrect calculation of the v_separation where it was not needed.

To better understand the issue, this is how the v_separation is used:
image
Every item has a top separation of 5, and a bottom separation of 5 (v_separation = 10).
Therefore the following statement is true: 1x item has 1x v_separation, which is also the fix for both calculation issues.

This was caused by an incorrect calculation of the v_separation where it was not needed
@Maran23 Maran23 requested a review from a team as a code owner December 14, 2023 01:45
@Calinou Calinou added this to the 4.3 milestone Dec 14, 2023
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I can confirm that PopupMenu is quite glitchy before this fix (e.g. try shrinking PopupMenu with 2 items and 0 separation. It will show the scrollbar...). Though the old code does not look obviously wrong to me, so I can't say how correct is the fix. It does not seem to break anything at least.

@YuriSizov YuriSizov self-requested a review December 22, 2023 15:56
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. It looks like modified code treated separation as an external element, something added in between items. But we clearly use the separation as a part of each item. This may be inconsistent with other GUI elements, but that's another topic. For fixing the bugs this all makes sense and does work.

@akien-mga akien-mga merged commit c1da69d into godotengine:master Jan 15, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Popup hover and height calculation are off by some pixels
5 participants