mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they only use euclid internally so that's not blocking landing the rest of the changes. Given the size of this patch, I think it's useful to get this landed as-is.
This commit is contained in:
parent
2ff7cb5a37
commit
3d57c22e9c
133 changed files with 686 additions and 596 deletions
|
@ -12,7 +12,7 @@ use crate::dom::bindings::root::{Dom, DomRoot};
|
|||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::window::Window;
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::TypedSize2D;
|
||||
use euclid::Size2D;
|
||||
use profile_traits::ipc;
|
||||
use script_traits::ScriptMsg;
|
||||
use style_traits::CSSPixel;
|
||||
|
@ -40,7 +40,7 @@ impl Screen {
|
|||
)
|
||||
}
|
||||
|
||||
fn screen_size(&self) -> TypedSize2D<u32, CSSPixel> {
|
||||
fn screen_size(&self) -> Size2D<u32, CSSPixel> {
|
||||
let (send, recv) =
|
||||
ipc::channel::<DeviceIntSize>(self.global().time_profiler_chan().clone()).unwrap();
|
||||
self.window
|
||||
|
@ -49,11 +49,11 @@ impl Screen {
|
|||
.send(ScriptMsg::GetScreenSize(send))
|
||||
.unwrap();
|
||||
let dpr = self.window.device_pixel_ratio();
|
||||
let screen = recv.recv().unwrap_or(TypedSize2D::zero());
|
||||
let screen = recv.recv().unwrap_or(Size2D::zero());
|
||||
(screen.to_f32() / dpr).to_u32()
|
||||
}
|
||||
|
||||
fn screen_avail_size(&self) -> TypedSize2D<u32, CSSPixel> {
|
||||
fn screen_avail_size(&self) -> Size2D<u32, CSSPixel> {
|
||||
let (send, recv) =
|
||||
ipc::channel::<DeviceIntSize>(self.global().time_profiler_chan().clone()).unwrap();
|
||||
self.window
|
||||
|
@ -62,7 +62,7 @@ impl Screen {
|
|||
.send(ScriptMsg::GetScreenAvailSize(send))
|
||||
.unwrap();
|
||||
let dpr = self.window.device_pixel_ratio();
|
||||
let screen = recv.recv().unwrap_or(TypedSize2D::zero());
|
||||
let screen = recv.recv().unwrap_or(Size2D::zero());
|
||||
(screen.to_f32() / dpr).to_u32()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue