Address review comments

This commit is contained in:
Patrick Walton 2013-06-04 15:23:18 -07:00
parent 8d3b6aefa8
commit 40a69fc517
4 changed files with 85 additions and 59 deletions

View file

@ -115,12 +115,10 @@ impl Layout {
let image_cache = self.local_image_cache;
let font_ctx = self.font_ctx;
let screen_size = self.screen_size.unwrap();
let doc_url = self.doc_url.clone();
LayoutContext {
image_cache: image_cache,
font_ctx: font_ctx,
doc_url: doc_url.unwrap(),
screen_size: Rect(Point2D(Au(0), Au(0)), screen_size),
}
}
@ -348,10 +346,12 @@ impl Layout {
let display_list = &display_list.take().list;
for display_list.each_reverse |display_item| {
let bounds = display_item.bounds();
// FIXME(pcwalton): Move this to be a method on Rect.
if x <= bounds.origin.x + bounds.size.width &&
bounds.origin.x <= x &&
y < bounds.origin.y + bounds.size.height &&
bounds.origin.y < y {
x >= bounds.origin.x &&
y < bounds.origin.y + bounds.size.height &&
y >= bounds.origin.y {
resp = Ok(HitTestResponse(display_item.base().extra.node()));
break;
}