mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Support painting infinitely sized rectangles
This commit is contained in:
@@ -455,8 +455,12 @@ pub fn mesh_command(options: MesherOptions, fonts: &Fonts, command: PaintCmd, ou
|
|||||||
corner_radius,
|
corner_radius,
|
||||||
fill_color,
|
fill_color,
|
||||||
outline,
|
outline,
|
||||||
rect,
|
mut rect,
|
||||||
} => {
|
} => {
|
||||||
|
// Common bug is to accidentally create an infinitely sized ractangle.
|
||||||
|
// Make sure we can visualize that:
|
||||||
|
rect.max = rect.max.min(pos2(1e7, 1e7));
|
||||||
|
|
||||||
let mut path = Path::default();
|
let mut path = Path::default();
|
||||||
path.add_rounded_rectangle(rect, corner_radius);
|
path.add_rounded_rectangle(rect, corner_radius);
|
||||||
if let Some(fill_color) = fill_color {
|
if let Some(fill_color) = fill_color {
|
||||||
|
|||||||
Reference in New Issue
Block a user