From 63a087f2651adca5cfb49e3f0fd21205c0f9c4f5 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 29 Mar 2022 18:50:34 +0200 Subject: [PATCH] Simplify resize handle hover handling --- nih_plug_vizia/src/widgets/resize_handle.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nih_plug_vizia/src/widgets/resize_handle.rs b/nih_plug_vizia/src/widgets/resize_handle.rs index 20fd74a1..61aa299f 100644 --- a/nih_plug_vizia/src/widgets/resize_handle.rs +++ b/nih_plug_vizia/src/widgets/resize_handle.rs @@ -69,11 +69,10 @@ impl View for ResizeHandle { } } WindowEvent::MouseMove(x, y) => { - if !intersects_triangle(cx.cache.get_bounds(cx.current), (x, y)) { - cx.current.set_hover(cx, false); - } else { - cx.current.set_hover(cx, true); - } + cx.current.set_hover( + cx, + intersects_triangle(cx.cache.get_bounds(cx.current), (x, y)), + ); if self.drag_active { // We need to convert our measurements into physical pixels relative to the