ggerganov / imtui

ImTui: Immediate Mode Text-based User Interface C++ Library
https://imtui.ggerganov.com
MIT License
2.94k stars 123 forks source link

VSlider knob clips at top and often also at the bottom #43

Open saurik opened 2 years ago

saurik commented 2 years ago

This is visible in the imtui online demo (so it should be easy to see): if you go under Widgets / Vertical Sliders the sliders have knobs that are 2 rows tall, except when at the very top they are being rendered as one row tall... but clearly with the space where the second row would be being rendered, so it isn't like it is somehow off the top of the slider or anything. Some of the sliders (the ones towards the left) are exhibiting the same behavior at the bottom.

ggerganov commented 2 years ago

Thanks for the report.

You should be able to fix this visual artifact using:

ImGui::GetStyle().GrabMinSize = 1.0f;

By default, the value is 0.1f:

https://github.com/ggerganov/imtui/blob/85d141de111f638a129a7a7a166d09cf0c5b5749/src/imtui-impl-text.cpp#L266