feat: Add with_sweep_range() method for

control over knob start position and rotation range. Maintains backward compatibility
This commit is contained in:
sacha-renault
2025-07-05 21:45:57 +02:00
parent 06bca1c13a
commit 9968afbe48
2 changed files with 38 additions and 4 deletions

View File

@@ -117,7 +117,8 @@ impl eframe::App for KnobExample {
egui::Color32::from_rgb(100, 255, 100),
)
.with_size(50.0)
.with_label_format(|v| format!("{:.2}%", v)),
.with_label_format(|v| format!("{:.2}%", v))
.with_sweep_range(1. / 8., 0.75),
);
ui.add(
@@ -128,7 +129,8 @@ impl eframe::App for KnobExample {
egui::Color32::from_rgb(50, 50, 220),
egui::Color32::from_rgb(100, 100, 255),
)
.with_size(50.0),
.with_size(50.0)
.with_sweep_range(0., 2.),
);
});
});