From 5814626dbe0589c0e765adcc1d719f26ee73e7c1 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 3 Feb 2020 12:10:36 +0300 Subject: [PATCH] anvil.window_map: rename input_bbox to bbox Since this value turns out to be more useful than for just input fast path. --- anvil/src/window_map.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/anvil/src/window_map.rs b/anvil/src/window_map.rs index 5d59831..10e0ef0 100644 --- a/anvil/src/window_map.rs +++ b/anvil/src/window_map.rs @@ -46,10 +46,11 @@ where struct Window { location: (i32, i32), - /// A bounding box over the input areas of this window and its children. + /// A bounding box over this window and its children. /// - /// Used for the fast path of the check in `matching`. - input_bbox: Rectangle, + /// Used for the fast path of the check in `matching`, and as the fall-back for the window + /// geometry if that's not set explicitly. + bbox: Rectangle, toplevel: Kind, } @@ -71,7 +72,7 @@ where where F: Fn(&SurfaceAttributes, (f64, f64)) -> bool, { - if !self.input_bbox.contains((point.0 as i32, point.1 as i32)) { + if !self.bbox.contains((point.0 as i32, point.1 as i32)) { return None; } // need to check more carefully @@ -143,7 +144,7 @@ where |_, _, _, _| true, ); } - self.input_bbox = Rectangle { + self.bbox = Rectangle { x: min_x, y: min_y, width: max_x - min_x, @@ -179,7 +180,7 @@ where pub fn insert(&mut self, toplevel: Kind, location: (i32, i32)) { let mut window = Window { location, - input_bbox: Rectangle::default(), + bbox: Rectangle::default(), toplevel, }; window.self_update(self.ctoken, &self.get_size);