mirror of
https://github.com/servo/servo.git
synced 2025-07-29 10:10:34 +01:00
Update to euclid 0.8
This commit is contained in:
parent
b7facf41cb
commit
6259df5e2d
56 changed files with 538 additions and 558 deletions
|
@ -2807,7 +2807,7 @@ impl DocumentMethods for Document {
|
|||
fn ElementFromPoint(&self, x: Finite<f64>, y: Finite<f64>) -> Option<Root<Element>> {
|
||||
let x = *x as f32;
|
||||
let y = *y as f32;
|
||||
let point = &Point2D { x: x, y: y };
|
||||
let point = &Point2D::new(x, y);
|
||||
let window = window_from_node(self);
|
||||
let viewport = window.window_size().unwrap().visible_viewport;
|
||||
|
||||
|
@ -2815,7 +2815,7 @@ impl DocumentMethods for Document {
|
|||
return None;
|
||||
}
|
||||
|
||||
if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
|
||||
if x < 0.0 || y < 0.0 || x > viewport.width || y > viewport.height {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -2840,7 +2840,7 @@ impl DocumentMethods for Document {
|
|||
fn ElementsFromPoint(&self, x: Finite<f64>, y: Finite<f64>) -> Vec<Root<Element>> {
|
||||
let x = *x as f32;
|
||||
let y = *y as f32;
|
||||
let point = &Point2D { x: x, y: y };
|
||||
let point = &Point2D::new(x, y);
|
||||
let window = window_from_node(self);
|
||||
let viewport = window.window_size().unwrap().visible_viewport;
|
||||
|
||||
|
@ -2849,7 +2849,7 @@ impl DocumentMethods for Document {
|
|||
}
|
||||
|
||||
// Step 2
|
||||
if x < 0.0 || y < 0.0 || x > viewport.width.get() || y > viewport.height.get() {
|
||||
if x < 0.0 || y < 0.0 || x > viewport.width || y > viewport.height {
|
||||
return vec!();
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ use timers::{IsInterval, OneshotTimerCallback, OneshotTimerHandle, OneshotTimers
|
|||
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
|
||||
use tinyfiledialogs::{self, MessageBoxIcon};
|
||||
use url::Url;
|
||||
use util::geometry::{self, MAX_RECT};
|
||||
use util::geometry::{self, max_rect};
|
||||
use util::opts;
|
||||
use util::prefs::PREFS;
|
||||
use webdriver_handlers::jsval_to_webdriver;
|
||||
|
@ -751,7 +751,7 @@ impl WindowMethods for Window {
|
|||
//TODO Include Scrollbar
|
||||
fn InnerHeight(&self) -> i32 {
|
||||
self.window_size.get()
|
||||
.and_then(|e| e.visible_viewport.height.get().to_i32())
|
||||
.and_then(|e| e.visible_viewport.height.to_i32())
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
|
@ -759,7 +759,7 @@ impl WindowMethods for Window {
|
|||
//TODO Include Scrollbar
|
||||
fn InnerWidth(&self) -> i32 {
|
||||
self.window_size.get()
|
||||
.and_then(|e| e.visible_viewport.width.get().to_i32())
|
||||
.and_then(|e| e.visible_viewport.width.to_i32())
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ impl Window {
|
|||
return false;
|
||||
}
|
||||
|
||||
let had_clip_rect = clip_rect != MAX_RECT;
|
||||
let had_clip_rect = clip_rect != max_rect();
|
||||
if had_clip_rect && !should_move_clip_rect(clip_rect, viewport) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1537,7 +1537,7 @@ impl Window {
|
|||
self.page_clip_rect.set(proposed_clip_rect);
|
||||
|
||||
// If we didn't have a clip rect, the previous display doesn't need rebuilding
|
||||
// because it was built for infinite clip (MAX_RECT).
|
||||
// because it was built for infinite clip (max_rect()).
|
||||
had_clip_rect
|
||||
}
|
||||
|
||||
|
@ -1721,7 +1721,7 @@ impl Window {
|
|||
resource_threads: resource_threads,
|
||||
bluetooth_thread: bluetooth_thread,
|
||||
constellation_chan: constellation_chan,
|
||||
page_clip_rect: Cell::new(MAX_RECT),
|
||||
page_clip_rect: Cell::new(max_rect()),
|
||||
fragment_name: DOMRefCell::new(None),
|
||||
resize_event: Cell::new(None),
|
||||
next_subpage_id: Cell::new(SubpageId(0)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue