mirror of
https://github.com/servo/servo.git
synced 2025-06-04 07:35:36 +00:00
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 <mrobinson@igalia.com>
This commit is contained in:
parent
649291bf69
commit
6300e820b4
1 changed files with 4 additions and 4 deletions
|
@ -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<f32, DeviceIndependentPixel>) -> bool {
|
||||
/// Return true iff the given position is over the egui toolbar.
|
||||
fn is_in_egui_toolbar_rect(&self, position: Point2D<f32, DeviceIndependentPixel>) -> bool {
|
||||
position.y < self.toolbar_height.get()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue