mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Deprecate old DragValue constructors in favor of DragValue::new
This commit is contained in:
@@ -62,7 +62,7 @@ impl PlotDemo {
|
||||
ui.vertical(|ui| {
|
||||
ui.label("Circle:");
|
||||
ui.add(
|
||||
egui::DragValue::f32(circle_radius)
|
||||
egui::DragValue::new(circle_radius)
|
||||
.speed(0.1)
|
||||
.clamp_range(0.0..=f32::INFINITY)
|
||||
// .logarithmic(true)
|
||||
@@ -71,14 +71,14 @@ impl PlotDemo {
|
||||
);
|
||||
ui.horizontal(|ui| {
|
||||
ui.add(
|
||||
egui::DragValue::f32(&mut circle_center.x)
|
||||
egui::DragValue::new(&mut circle_center.x)
|
||||
.speed(0.1)
|
||||
// .logarithmic(true)
|
||||
// .smallest_positive(1e-2)
|
||||
.prefix("x: "),
|
||||
);
|
||||
ui.add(
|
||||
egui::DragValue::f32(&mut circle_center.y)
|
||||
egui::DragValue::new(&mut circle_center.y)
|
||||
.speed(1.0)
|
||||
// .logarithmic(true)
|
||||
// .smallest_positive(1e-2)
|
||||
|
||||
@@ -67,7 +67,7 @@ impl super::View for Scrolling {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Scroll to a specific offset:");
|
||||
go_to_scroll_offset |= ui
|
||||
.add(DragValue::f32(&mut self.offset).speed(1.0).suffix("px"))
|
||||
.add(DragValue::new(&mut self.offset).speed(1.0).suffix("px"))
|
||||
.dragged();
|
||||
});
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ impl WidgetGallery {
|
||||
ui.end_row();
|
||||
|
||||
ui.add(doc_link_label("DragValue", "DragValue"));
|
||||
ui.add(egui::DragValue::f32(scalar).speed(1.0));
|
||||
ui.add(egui::DragValue::new(scalar).speed(1.0));
|
||||
ui.end_row();
|
||||
|
||||
ui.add(doc_link_label("Color picker", "color_edit"));
|
||||
|
||||
Reference in New Issue
Block a user