Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSS/NSPR, scroll fixes, texture upload fixes, and hit testing #495

Closed
wants to merge 16 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

base and bounds methods for DisplayItem

  • Loading branch information
Tim Kuehn authored and pcwalton committed May 31, 2013
commit ea1a406589b391fcf0dbcf523969e134decaf227
@@ -19,6 +19,7 @@ use geometry::Au;
use render_context::RenderContext;
use text::SendableTextRun;

use core::cast::transmute_region;
use geom::{Point2D, Rect, Size2D};
use servo_net::image::base::Image;
use servo_util::range::Range;
@@ -151,5 +152,21 @@ impl<E> DisplayItem<E> {
}
}
}

fn base<'a>(&'a self) -> &'a BaseDisplayItem<E> {
// FIXME(tkuehn): Workaround for Rust region bug.
unsafe {
match *self {
SolidColorDisplayItemClass(ref solid_color) => transmute_region(&solid_color.base),
TextDisplayItemClass(ref text) => transmute_region(&text.base),
ImageDisplayItemClass(ref image_item) => transmute_region(&image_item.base),
BorderDisplayItemClass(ref border) => transmute_region(&border.base)
}
}
}

fn bounds(&self) -> Rect<Au> {
self.base().bounds
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.