sliderVector
Parameters
- line:std.builtin.SourceLocation
- std.builtin.SourceLocation
- fmt:[]const u8
- []const u8
- num_components:u32
- u32
- value:anytype
- anytype
- init_opts:SliderVectorInitOptions
- SliderVectorInitOptions
- opts:Options
- Options
Source
Implementation
pub fn sliderVector(line: std.builtin.SourceLocation, comptime fmt: []const u8, comptime num_components: u32, value: anytype, init_opts: SliderVectorInitOptions, opts: Options) bool {
var data_arr = checkAndCastDataPtr(num_components, value);
var any_changed = false;
inline for (0..num_components) |i| {
const component_opts = dvui.SliderEntryInitOptions{
.value = &data_arr[i],
.min = init_opts.min,
.max = init_opts.max,
.interval = init_opts.interval,
};
const component_changed = dvui.sliderEntry(line, fmt, component_opts, opts.override(.{ .id_extra = i, .expand = .both }));
any_changed = any_changed or component_changed;
}
return any_changed;
}