diff --git a/egui/src/containers/window.rs b/egui/src/containers/window.rs index f217f75c..63af610d 100644 --- a/egui/src/containers/window.rs +++ b/egui/src/containers/window.rs @@ -715,13 +715,13 @@ fn close_button(ui: &mut Ui, rect: Rect) -> InteractInfo { let stroke_width = ui.style().interact(&interact).stroke_width; ui.painter().add(PaintCmd::line_segment( [rect.left_top(), rect.right_bottom()], - stroke_color, stroke_width, + stroke_color, )); ui.painter().add(PaintCmd::line_segment( [rect.right_top(), rect.left_bottom()], - stroke_color, stroke_width, + stroke_color, )); interact } diff --git a/egui/src/demos/fractal_clock.rs b/egui/src/demos/fractal_clock.rs index 2c8caa95..1aaf0e2e 100644 --- a/egui/src/demos/fractal_clock.rs +++ b/egui/src/demos/fractal_clock.rs @@ -134,7 +134,7 @@ impl FractalClock { rect.center() + scale * points[1].to_vec2(), ]; - painter.add(PaintCmd::line_segment([line[0], line[1]], color, width)); + painter.add(PaintCmd::line_segment([line[0], line[1]], width, color)); }; let hand_rotations = [ diff --git a/egui/src/paint/command.rs b/egui/src/paint/command.rs index 420cf799..3392cd0c 100644 --- a/egui/src/paint/command.rs +++ b/egui/src/paint/command.rs @@ -42,7 +42,7 @@ pub enum PaintCmd { } impl PaintCmd { - pub fn line_segment(points: [Pos2; 2], color: Color, width: f32) -> Self { + pub fn line_segment(points: [Pos2; 2], width: f32, color: Color) -> Self { Self::LineSegment { points, style: LineStyle::new(width, color), diff --git a/egui/src/ui.rs b/egui/src/ui.rs index 30c4dff7..d1856486 100644 --- a/egui/src/ui.rs +++ b/egui/src/ui.rs @@ -403,7 +403,7 @@ impl Ui { let paint_line_seg = |a, b| { self.painter - .add(PaintCmd::line_segment([a, b], color, width)) + .add(PaintCmd::line_segment([a, b], width, color)) }; if too_wide { @@ -567,8 +567,8 @@ impl Ui { let line_end = pos2(line_start.x, line_start.y + size.y - 2.0); self.painter.add(PaintCmd::line_segment( [line_start, line_end], - gray(150, 255), self.style.line_width, + gray(150, 255), )); (ret, self.allocate_space(indent + size)) diff --git a/egui/src/widgets.rs b/egui/src/widgets.rs index 254070fd..35e8744c 100644 --- a/egui/src/widgets.rs +++ b/egui/src/widgets.rs @@ -201,8 +201,8 @@ impl Widget for Hyperlink { let max_x = pos.x + line.max_x(); ui.painter().add(PaintCmd::line_segment( [pos2(min_x, y), pos2(max_x, y)], - color, ui.style().line_width, + color, )); } } diff --git a/egui/src/widgets/text_edit.rs b/egui/src/widgets/text_edit.rs index 71c6281f..1461abd8 100644 --- a/egui/src/widgets/text_edit.rs +++ b/egui/src/widgets/text_edit.rs @@ -202,8 +202,8 @@ impl<'t> Widget for TextEdit<'t> { let cursor_pos = interact.rect.min + galley.char_start_pos(cursor); painter.add(PaintCmd::line_segment( [cursor_pos, cursor_pos + vec2(0.0, line_spacing)], - color::WHITE, ui.style().text_cursor_width, + color::WHITE, )); } }