Require a StrokeKind when painting rectangles with strokes (#5648)

This is a breaking change, requiring users to think about wether the
stroke is inside/centered/outside the rect.

When in doubt, add `egui::StrokeKind::Inside` to the function call.
This commit is contained in:
Emil Ernerfeldt
2025-01-29 15:52:49 +01:00
committed by GitHub
parent 8d2c8c203c
commit 525d435a84
35 changed files with 184 additions and 73 deletions
@@ -1,6 +1,7 @@
use egui::epaint::{CubicBezierShape, PathShape, QuadraticBezierShape};
use egui::{
emath, epaint, pos2, Color32, Context, Frame, Grid, Pos2, Rect, Sense, Shape, Stroke, Ui, Vec2,
emath,
epaint::{self, CubicBezierShape, PathShape, QuadraticBezierShape},
pos2, Color32, Context, Frame, Grid, Pos2, Rect, Sense, Shape, Stroke, StrokeKind, Ui, Vec2,
Widget, Window,
};
@@ -132,6 +133,7 @@ impl PaintBezier {
shape.visual_bounding_rect(),
0.0,
self.bounding_box_stroke,
StrokeKind::Outside,
));
painter.add(shape);
}
@@ -143,6 +145,7 @@ impl PaintBezier {
shape.visual_bounding_rect(),
0.0,
self.bounding_box_stroke,
StrokeKind::Outside,
));
painter.add(shape);
}