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:
@@ -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]],
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user