mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Outside of compositor, store window size in CSS px
This fixes an issue where the CSS viewport was too large on high-DPI displays because it was set to the window size in device pixels, instead of px. This patch ensures that the window size is converted from device pixels to px before being passed to script/layout code. The Window trait now exposes the window size in both device pixels and density-independent screen coordinates, with clearer method names.
This commit is contained in:
parent
e98b03f581
commit
89327aa5be
15 changed files with 104 additions and 85 deletions
|
@ -10,14 +10,16 @@ use dom::bindings::error::Fallible;
|
|||
use dom::eventtarget::EventTarget;
|
||||
use dom::window::Window;
|
||||
use servo_util::str::DOMString;
|
||||
use servo_util::geometry::PagePx;
|
||||
use std::cell::Cell;
|
||||
|
||||
use geom::point::Point2D;
|
||||
use geom::size::TypedSize2D;
|
||||
|
||||
use time;
|
||||
|
||||
pub enum Event_ {
|
||||
ResizeEvent(uint, uint),
|
||||
ResizeEvent(TypedSize2D<PagePx, f32>),
|
||||
ReflowEvent,
|
||||
ClickEvent(uint, Point2D<f32>),
|
||||
MouseDownEvent(uint, Point2D<f32>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue