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:
Omar Akkila 2017-07-07 11:42:53 +04:00
parent eec51cdd57
commit 420a7878b9
3 changed files with 37 additions and 39 deletions

View file

@ -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) +