Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

DropDownList displayed element is not vertically centered #3050

Open
Lys0gen opened this issue Aug 13, 2022 · 1 comment
Open

DropDownList displayed element is not vertically centered #3050

Lys0gen opened this issue Aug 13, 2022 · 1 comment
Labels

Comments

@Lys0gen
Copy link

Lys0gen commented Aug 13, 2022

When the DropDownList and entry Text elements don't have the exact same size then the displayed entry will be top-aligned which doesn't look very good imo. Can be seen in sample 54.

My proposed solution would be to simply add the difference to the offset here:

https://github.com/urho3d/Urho3D/blob/33ae5192b214465f20f6b16a1078ea0701b63eaa/Source/Urho3D/UI/DropDownList.cpp#L81

Adding this works good for me:

	offset.y_ += (GetSize().y_ - selectedItem->GetSize().y_) / 2;

Don't know if this leads to undesirable behaviour elsewhere but I doubt it.

@github-actions
Copy link

Marking this stale since there has been no activity for 30 days.
It will be closed if there is no activity for another 15 days.

@github-actions github-actions bot added the stale label Sep 13, 2022
@1vanK 1vanK added backlog and removed stale labels Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants