rust-geom API changes

https://github.com/servo/rust-geom/pull/81
This commit is contained in:
Corey Farwell 2015-06-11 20:51:07 -07:00
parent a9aa50683f
commit 5c408d2be9
39 changed files with 397 additions and 377 deletions

View file

@ -277,7 +277,7 @@ pub fn rect_contains_point<T:PartialOrd + Add<T, Output=T>>(rect: Rect<T>, point
/// A helper function to convert a rect of `f32` pixels to a rect of app units.
pub fn f32_rect_to_au_rect(rect: Rect<f32>) -> Rect<Au> {
Rect(Point2D(Au::from_f32_px(rect.origin.x), Au::from_f32_px(rect.origin.y)),
Size2D(Au::from_f32_px(rect.size.width), Au::from_f32_px(rect.size.height)))
Rect::new(Point2D::new(Au::from_f32_px(rect.origin.x), Au::from_f32_px(rect.origin.y)),
Size2D::new(Au::from_f32_px(rect.size.width), Au::from_f32_px(rect.size.height)))
}

View file

@ -8,7 +8,7 @@
use geometry::ScreenPx;
use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
use geom::size::{Size2D, TypedSize2D};
use layers::geometry::DevicePixel;
use getopts;
use num_cpus;
@ -230,7 +230,7 @@ pub fn default_opts() -> Opts {
trace_layout: false,
devtools_port: None,
webdriver_port: None,
initial_window_size: TypedSize2D(800, 600),
initial_window_size: Size2D::typed(800, 600),
user_agent: None,
dump_flow_tree: false,
dump_display_list: false,
@ -375,10 +375,10 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
let initial_window_size = match opt_match.opt_str("resolution") {
Some(res_string) => {
let res: Vec<u32> = res_string.split('x').map(|r| r.parse().unwrap()).collect();
TypedSize2D(res[0], res[1])
Size2D::typed(res[0], res[1])
}
None => {
TypedSize2D(800, 600)
Size2D::typed(800, 600)
}
};