Color picker: fix rare infinite loop in very weird situtations

This commit is contained in:
Emil Ernerfeldt 2021-05-20 22:05:44 +02:00
parent f4ddc21740
commit 2dea4d8db2

View file

@ -19,6 +19,9 @@ const N: u32 = 6 * 6;
fn background_checkers(painter: &Painter, rect: Rect) {
let rect = rect.shrink(0.5); // Small hack to avoid the checkers from peeking through the sides
if !rect.is_positive() {
return;
}
let mut top_color = Color32::from_gray(128);
let mut bottom_color = Color32::from_gray(32);