mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add transparent padding around ServoSurface
This commit is contained in:
parent
40d599e39f
commit
8f2390fdff
10 changed files with 186 additions and 74 deletions
|
@ -18,7 +18,8 @@ use std::fmt::{Debug, Error, Formatter};
|
|||
use std::rc::Rc;
|
||||
use style_traits::DevicePixel;
|
||||
use webrender_api::{
|
||||
DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, FramebufferIntSize, ScrollLocation,
|
||||
DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, FramebufferIntRect,
|
||||
FramebufferIntSize, ScrollLocation,
|
||||
};
|
||||
use webvr::VRServiceManager;
|
||||
use webvr_traits::WebVRMainThreadHeartbeat;
|
||||
|
@ -173,3 +174,12 @@ pub struct EmbedderCoordinates {
|
|||
/// Coordinates of the document within the framebuffer.
|
||||
pub viewport: DeviceIntRect,
|
||||
}
|
||||
|
||||
impl EmbedderCoordinates {
|
||||
pub fn get_flipped_viewport(&self) -> FramebufferIntRect {
|
||||
let fb_height = self.framebuffer.height;
|
||||
let mut view = self.viewport.clone();
|
||||
view.origin.y = fb_height - view.origin.y - view.size.height;
|
||||
FramebufferIntRect::from_untyped(&view.to_untyped())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue