mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update to euclid 0.8
This commit is contained in:
parent
b7facf41cb
commit
6259df5e2d
56 changed files with 538 additions and 558 deletions
|
@ -10,12 +10,12 @@ name = "style_traits"
|
|||
path = "lib.rs"
|
||||
|
||||
[features]
|
||||
servo = ["heapsize", "heapsize_plugin", "serde", "serde_macros", "euclid/plugins",
|
||||
servo = ["heapsize", "heapsize_plugin", "serde", "serde_macros",
|
||||
"cssparser/heap_size", "cssparser/serde-serialization"]
|
||||
|
||||
[dependencies]
|
||||
cssparser = "0.5.4"
|
||||
euclid = "0.7.1"
|
||||
euclid = "0.8.2"
|
||||
heapsize = {version = "0.3.0", optional = true}
|
||||
heapsize_plugin = {version = "0.1.2", optional = true}
|
||||
rustc-serialize = "0.3"
|
||||
|
|
|
@ -23,11 +23,11 @@ define_css_keyword_enum!(Orientation:
|
|||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize, HeapSizeOf))]
|
||||
pub struct ViewportConstraints {
|
||||
pub size: TypedSize2D<ViewportPx, f32>,
|
||||
pub size: TypedSize2D<f32, ViewportPx>,
|
||||
|
||||
pub initial_zoom: ScaleFactor<PagePx, ViewportPx, f32>,
|
||||
pub min_zoom: Option<ScaleFactor<PagePx, ViewportPx, f32>>,
|
||||
pub max_zoom: Option<ScaleFactor<PagePx, ViewportPx, f32>>,
|
||||
pub initial_zoom: ScaleFactor<f32, PagePx, ViewportPx>,
|
||||
pub min_zoom: Option<ScaleFactor<f32, PagePx, ViewportPx>>,
|
||||
pub max_zoom: Option<ScaleFactor<f32, PagePx, ViewportPx>>,
|
||||
|
||||
pub user_zoom: UserZoom,
|
||||
pub orientation: Orientation
|
||||
|
@ -38,8 +38,8 @@ impl ToCss for ViewportConstraints {
|
|||
where W: fmt::Write
|
||||
{
|
||||
try!(write!(dest, "@viewport {{"));
|
||||
try!(write!(dest, " width: {}px;", self.size.width.get()));
|
||||
try!(write!(dest, " height: {}px;", self.size.height.get()));
|
||||
try!(write!(dest, " width: {}px;", self.size.width));
|
||||
try!(write!(dest, " height: {}px;", self.size.height));
|
||||
try!(write!(dest, " zoom: {};", self.initial_zoom.get()));
|
||||
if let Some(min_zoom) = self.min_zoom {
|
||||
try!(write!(dest, " min-zoom: {};", min_zoom.get()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue