mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
This change makes it easier for embedders to embed the types that they need by exporting almost everything necessary to use Servo at the root of libservo, apart from a few exceptions. In addition, the `Servo` is moved to its own file so that public exports can be more easily spotted from `components/servo/lib.rs`. Testing: This should not change behavior and is thus covered by existing tests. Fixes: #18475. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
16 lines
588 B
Rust
16 lines
588 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::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)
|
|
}
|