1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Fix a few nightly clippy lints (#8388)

This commit is contained in:
Emil Ernerfeldt
2026-08-04 12:40:56 -07:00
committed by GitHub
parent 5347b0a4ac
commit 90e03028f7
6 changed files with 17 additions and 13 deletions

View File

@@ -3,7 +3,7 @@
use std::ops::Range;
use crate::{Color32, PathShape, PathStroke, Shape};
use emath::{Pos2, Rect, RectTransform};
use emath::{Pos2, Rect, RectTransform, fast_midpoint};
// ----------------------------------------------------------------------------
@@ -689,8 +689,8 @@ fn single_curve_approximation(curve: &CubicBezierShape) -> QuadraticBezierShape
let c2_x = (curve.points[2].x * 3.0 - curve.points[3].x) * 0.5;
let c2_y = (curve.points[2].y * 3.0 - curve.points[3].y) * 0.5;
let c = Pos2 {
x: (c1_x + c2_x) * 0.5,
y: (c1_y + c2_y) * 0.5,
x: fast_midpoint(c1_x, c2_x),
y: fast_midpoint(c1_y, c2_y),
};
QuadraticBezierShape {
points: [curve.points[0], c, curve.points[3]],

View File

@@ -5,7 +5,9 @@
#![expect(clippy::identity_op)]
use emath::{GuiRounding as _, NumExt as _, Pos2, Rect, Rot2, Vec2, pos2, remap, vec2};
use emath::{
GuiRounding as _, NumExt as _, Pos2, Rect, Rot2, Vec2, fast_midpoint, pos2, remap, vec2,
};
use crate::{
CircleShape, ClippedPrimitive, ClippedShape, Color32, CornerRadiusF32, CubicBezierShape,
@@ -1074,7 +1076,7 @@ fn stroke_and_fill_path(
*/
let inner_rad = 0.5 * (stroke.width - feathering);
let outer_rad = 0.5 * (stroke.width + feathering);
let outer_rad = fast_midpoint(stroke.width, feathering);
match path_type {
PathType::Closed => {