Fix float-literal fallback lints for Rust 1.97
rustc 1.97 promotes the float-literal type-fallback check on generic `impl Into<f32>` arguments (rust#154024) to a denied lint, which breaks the editor's `#![deny(warnings)]` build: every bare literal passed to `egui::Stroke::new` now needs an explicit type. Suffix the eleven affected literals with `_f32`; no behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+10
-10
@@ -2251,7 +2251,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
stroke_rect(
|
stroke_rect(
|
||||||
&painter,
|
&painter,
|
||||||
tab_rect.shrink(1.5),
|
tab_rect.shrink(1.5),
|
||||||
egui::Stroke::new(3.0, color),
|
egui::Stroke::new(3.0_f32, color),
|
||||||
);
|
);
|
||||||
painter.text(
|
painter.text(
|
||||||
tab_rect.left_top() + egui::vec2(8.0, 6.0),
|
tab_rect.left_top() + egui::vec2(8.0, 6.0),
|
||||||
@@ -2312,7 +2312,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
egui::Color32::from_rgb(110, 220, 120) // green: solid
|
egui::Color32::from_rgb(110, 220, 120) // green: solid
|
||||||
};
|
};
|
||||||
let selected = self.state.selected == Some(entity);
|
let selected = self.state.selected == Some(entity);
|
||||||
let stroke = egui::Stroke::new(if selected { 2.0 } else { 1.2 }, color);
|
let stroke = egui::Stroke::new(if selected { 2.0_f32 } else { 1.2_f32 }, color);
|
||||||
for (a, b) in collider_wire_segments(&col) {
|
for (a, b) in collider_wire_segments(&col) {
|
||||||
let (Some(pa), Some(pb)) = (
|
let (Some(pa), Some(pb)) = (
|
||||||
project(pose.transform_point(a), &overlay.view_proj, tab_rect),
|
project(pose.transform_point(a), &overlay.view_proj, tab_rect),
|
||||||
@@ -2344,7 +2344,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
project(viz.origin, &overlay.view_proj, tab_rect),
|
project(viz.origin, &overlay.view_proj, tab_rect),
|
||||||
project(viz.end, &overlay.view_proj, tab_rect),
|
project(viz.end, &overlay.view_proj, tab_rect),
|
||||||
) {
|
) {
|
||||||
painter.line_segment([a, b], egui::Stroke::new(1.5, cyan));
|
painter.line_segment([a, b], egui::Stroke::new(1.5_f32, cyan));
|
||||||
}
|
}
|
||||||
|
|
||||||
// The hit surface: a dot at the contact point + a normal whisker.
|
// The hit surface: a dot at the contact point + a normal whisker.
|
||||||
@@ -2359,7 +2359,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
project(hit.point, &overlay.view_proj, tab_rect),
|
project(hit.point, &overlay.view_proj, tab_rect),
|
||||||
project(tip, &overlay.view_proj, tab_rect),
|
project(tip, &overlay.view_proj, tab_rect),
|
||||||
) {
|
) {
|
||||||
painter.line_segment([a, b], egui::Stroke::new(2.0, magenta));
|
painter.line_segment([a, b], egui::Stroke::new(2.0_f32, magenta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2470,7 +2470,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
) else {
|
) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
painter.line_segment([pa, pb], egui::Stroke::new(2.5, color));
|
painter.line_segment([pa, pb], egui::Stroke::new(2.5_f32, color));
|
||||||
// Arrowhead at the tip — a small filled triangle perpendicular to
|
// Arrowhead at the tip — a small filled triangle perpendicular to
|
||||||
// the line direction in screen space.
|
// the line direction in screen space.
|
||||||
let dir = (pb - pa).normalized();
|
let dir = (pb - pa).normalized();
|
||||||
@@ -2521,7 +2521,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
} else {
|
} else {
|
||||||
egui::Color32::from_rgba_unmultiplied(255, 120, 120, if engaged { 220 } else { 130 })
|
egui::Color32::from_rgba_unmultiplied(255, 120, 120, if engaged { 220 } else { 130 })
|
||||||
};
|
};
|
||||||
let stroke = egui::Stroke::new(1.5, color);
|
let stroke = egui::Stroke::new(1.5_f32, color);
|
||||||
painter.add(egui::Shape::convex_polygon(projected, color, stroke));
|
painter.add(egui::Shape::convex_polygon(projected, color, stroke));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2551,7 +2551,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let color = axis_color(axis, engaged);
|
let color = axis_color(axis, engaged);
|
||||||
painter.add(egui::Shape::line(pts, egui::Stroke::new(2.0, color)));
|
painter.add(egui::Shape::line(pts, egui::Stroke::new(2.0_f32, color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hierarchy(&mut self, ui: &mut egui::Ui) {
|
fn hierarchy(&mut self, ui: &mut egui::Ui) {
|
||||||
@@ -2705,7 +2705,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
DropZone::Child
|
DropZone::Child
|
||||||
};
|
};
|
||||||
let accent = ui.visuals().selection.bg_fill;
|
let accent = ui.visuals().selection.bg_fill;
|
||||||
let line = egui::Stroke::new(2.0, accent);
|
let line = egui::Stroke::new(2.0_f32, accent);
|
||||||
match zone {
|
match zone {
|
||||||
DropZone::Before => {
|
DropZone::Before => {
|
||||||
ui.painter().line_segment(
|
ui.painter().line_segment(
|
||||||
@@ -3333,7 +3333,7 @@ impl<'a> ShellTabViewer<'a> {
|
|||||||
if r.contains(pos) {
|
if r.contains(pos) {
|
||||||
let above = (pos.y - r.top()) < r.height() / 2.0;
|
let above = (pos.y - r.top()) < r.height() / 2.0;
|
||||||
let accent = ui.visuals().selection.bg_fill;
|
let accent = ui.visuals().selection.bg_fill;
|
||||||
let line = egui::Stroke::new(2.0, accent);
|
let line = egui::Stroke::new(2.0_f32, accent);
|
||||||
let y = if above { r.top() } else { r.bottom() };
|
let y = if above { r.top() } else { r.bottom() };
|
||||||
ui.painter().line_segment(
|
ui.painter().line_segment(
|
||||||
[egui::pos2(r.left(), y), egui::pos2(r.right(), y)],
|
[egui::pos2(r.left(), y), egui::pos2(r.right(), y)],
|
||||||
@@ -5165,7 +5165,7 @@ fn draw_ui_preview(ui: &mut egui::Ui, panel: &UiPanel) {
|
|||||||
stroke_rect(
|
stroke_rect(
|
||||||
&painter,
|
&painter,
|
||||||
egui::Rect::from_min_size(origin, draw),
|
egui::Rect::from_min_size(origin, draw),
|
||||||
egui::Stroke::new(1.0, egui::Color32::DARK_GRAY),
|
egui::Stroke::new(1.0_f32, egui::Color32::DARK_GRAY),
|
||||||
);
|
);
|
||||||
|
|
||||||
let theme = UiTheme::new();
|
let theme = UiTheme::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user