From 797663c43e54f1c294e21d5192ace3fc744e4b0e Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Mon, 7 Jul 2014 10:45:48 -0700 Subject: [PATCH 1/2] Update to latest rust-geom --- src/support/geom/rust-geom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/support/geom/rust-geom b/src/support/geom/rust-geom index 2b5981a97ab..862af73433f 160000 --- a/src/support/geom/rust-geom +++ b/src/support/geom/rust-geom @@ -1 +1 @@ -Subproject commit 2b5981a97ab607a7b24f39484105d17c1e3a6fb8 +Subproject commit 862af73433f36f156519ff24bd87abd3a8c10790 From 91c7acd4c4addb8acc7c192577b87f9bd137b376 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Mon, 7 Jul 2014 10:45:48 -0700 Subject: [PATCH 2/2] Adopt Rect::contains in compositor hit-testing This does make hit-testing inclusive in the right/bottom edges, whereas it was only inclusive in the top/left edges before. --- src/components/compositing/compositor_data.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/compositing/compositor_data.rs b/src/components/compositing/compositor_data.rs index a91637f054e..e0965aab059 100644 --- a/src/components/compositing/compositor_data.rs +++ b/src/components/compositing/compositor_data.rs @@ -230,12 +230,11 @@ impl CompositorData { } Some(rect) => { let rect: TypedRect = Rect::from_untyped(&rect); - if cursor.x >= rect.origin.x && cursor.x < rect.origin.x + rect.size.width - && cursor.y >= rect.origin.y && cursor.y < rect.origin.y + rect.size.height - && CompositorData::handle_scroll_event(child.clone(), - delta, - cursor - rect.origin, - rect.size) { + if rect.contains(&cursor) && + CompositorData::handle_scroll_event(child.clone(), + delta, + cursor - rect.origin, + rect.size) { return true } } @@ -312,8 +311,7 @@ impl CompositorData { } Some(rect) => { let rect: TypedRect = Rect::from_untyped(&rect); - if cursor.x >= rect.origin.x && cursor.x < rect.origin.x + rect.size.width - && cursor.y >= rect.origin.y && cursor.y < rect.origin.y + rect.size.height { + if rect.contains(&cursor) { CompositorData::send_mouse_event(child.clone(), event, cursor - rect.origin); return; }