mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Refactor HTMLImageElement::handle_event to be idiomatic
Clean up HTMLImageElement::handle_event Area::hit_test now uses a reference instead of taking ownership Fix trailing whitespace Unalign => in match Fix Area::hit_test tests to reflect updated function signature
This commit is contained in:
parent
eec51cdd57
commit
420a7878b9
3 changed files with 37 additions and 39 deletions
|
@ -167,7 +167,7 @@ impl Area {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn hit_test(&self, p: Point2D<f32>) -> bool {
|
||||
pub fn hit_test(&self, p: &Point2D<f32>) -> bool {
|
||||
match *self {
|
||||
Area::Circle { left, top, radius } => {
|
||||
(p.x - left) * (p.x - left) +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue