urho3d/urho3d

DropDownList displayed element is not vertically centered

Lys0gen opened this issue · 1 comments

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.

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.