mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
* Use webrender_api::units::DevicePixel rather than style_traits::DevicePixel unless interfacing with Stylo Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix OpenHarmony build Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
15 lines
610 B
Rust
15 lines
610 B
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
use euclid::{Point2D, Size2D};
|
|
use servo::webrender_api::units::DevicePixel;
|
|
use winit::dpi::{PhysicalPosition, PhysicalSize};
|
|
|
|
pub fn winit_size_to_euclid_size<T>(size: PhysicalSize<T>) -> Size2D<T, DevicePixel> {
|
|
Size2D::new(size.width, size.height)
|
|
}
|
|
|
|
pub fn winit_position_to_euclid_point<T>(position: PhysicalPosition<T>) -> Point2D<T, DevicePixel> {
|
|
Point2D::new(position.x, position.y)
|
|
}
|