From 6300e820b4e3fbfcec260048f931528d4998d5e4 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 3 Mar 2025 12:19:50 +0100 Subject: [PATCH] servoshell: Rename `Minibrowser::is_in_browser_rect` to `Minibrowser::is_in_egui_toolbar_rect` (#35717) "browser rect" is a bit of a misnomer as the browser is the entire window, but this function is trying to determine if a point is on the non-WebView toolbar portion of the GUI. Signed-off-by: Martin Robinson --- ports/servoshell/desktop/minibrowser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/servoshell/desktop/minibrowser.rs b/ports/servoshell/desktop/minibrowser.rs index 38506501738..3b6ccc42922 100644 --- a/ports/servoshell/desktop/minibrowser.rs +++ b/ports/servoshell/desktop/minibrowser.rs @@ -132,7 +132,7 @@ impl Minibrowser { self.last_mouse_position = Some(winit_position_to_euclid_point(*position).to_f32() / scale); self.last_mouse_position - .is_some_and(|p| self.is_in_browser_rect(p)) + .is_some_and(|p| self.is_in_egui_toolbar_rect(p)) }, WindowEvent::MouseInput { state: ElementState::Pressed, @@ -154,14 +154,14 @@ impl Minibrowser { }, WindowEvent::MouseWheel { .. } | WindowEvent::MouseInput { .. } => self .last_mouse_position - .is_some_and(|p| self.is_in_browser_rect(p)), + .is_some_and(|p| self.is_in_egui_toolbar_rect(p)), _ => true, }; result } - /// Return true iff the given position is in the Servo browser rect. - fn is_in_browser_rect(&self, position: Point2D) -> bool { + /// Return true iff the given position is over the egui toolbar. + fn is_in_egui_toolbar_rect(&self, position: Point2D) -> bool { position.y < self.toolbar_height.get() }