Page MenuHomeFeedback Tracker

DbgUI.SliderFloat() padding too much
Assigned, NormalPublic

Description

The length of the text label in a SliderFloat() widget is added as padding after the slider

This makes aligning text to the right of sliders difficult, as there can be a large gap between the slider and the following text

Details

Severity
Minor
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General
Steps To Reproduce

Use the following code:

DbgUI.Begin("Slider padding test", 100, 100);

float test1, test2, test3;

// The gap between the slider and the 2nd text changes as the slider label length changes
DbgUI.PushID(1);
DbgUI.SliderFloat("text", test1, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test1.ToString());
DbgUI.SliderFloat("more text", test2, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test2.ToString());
DbgUI.SliderFloat("even more text here", test3, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test3.ToString());
DbgUI.PopID();

DbgUI.Spacer(30);

// Aligning the sliders makes the padding after each slider become huge
DbgUI.PushID(2);
DbgUI.SliderFloat("text               ", test1, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test1.ToString());
DbgUI.SliderFloat("more text          ", test2, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test2.ToString());
DbgUI.SliderFloat("even more text here", test3, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test3.ToString());
DbgUI.PopID();

DbgUI.End();

Event Timeline

Geez changed the task status from New to Assigned.Wed, Jul 3, 2:01 PM