diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 306c75e80..f62f105c0 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -928,13 +928,12 @@ pub fn fill_stroke_proxy(ui: &mut Ui, fill: &Paint, stroke: &Paint, mixed: (bool /// A [`PanelDrag::Paint`] released on a Fill/Stroke proxy square: highlight while held over it. fn proxy_paint_drop(ui: &Ui, resp: &Response) -> Option { - if let Some(drag) = resp.dnd_hover_payload::() { - if let PanelDrag::Paint { params, .. } = &*drag { - if !params.is_null() { - let t = Tokens::get(ui.ctx()); - ui.painter().rect_stroke(resp.rect, 0.0, Stroke::new(2.0, t.accent), StrokeKind::Outside); - } - } + if let Some(drag) = resp.dnd_hover_payload::() + && let PanelDrag::Paint { params, .. } = &*drag + && !params.is_null() + { + let t = Tokens::get(ui.ctx()); + ui.painter().rect_stroke(resp.rect, 0.0, Stroke::new(2.0, t.accent), StrokeKind::Outside); } resp.dnd_release_payload::().and_then(|d| { let PanelDrag::Paint { params, .. } = &*d else { return None };