mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
More compact debug output for CSS values
``` Rect { start_corner: Vec2 { i: 0.0 px, b: 0.0 px }, size: Vec2 { i: 1024.0 px, b: 20.0 px }, } ``` … instead of: ``` Rect { start_corner: Vec2 { inline: CSSPixelLength( 0.0, ), block: CSSPixelLength( 0.0, ), }, size: Vec2 { inline: CSSPixelLength( 1024.0, ), block: CSSPixelLength( 0.0, ), }, } ```
This commit is contained in:
parent
cfc3ffcd54
commit
13e494d74f
2 changed files with 32 additions and 3 deletions
|
@ -611,7 +611,6 @@ impl Size {
|
|||
Clone,
|
||||
ComputeSquaredDistance,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
PartialOrd,
|
||||
|
@ -623,6 +622,13 @@ impl Size {
|
|||
#[repr(C)]
|
||||
pub struct CSSPixelLength(CSSFloat);
|
||||
|
||||
impl fmt::Debug for CSSPixelLength {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.0.fmt(f)?;
|
||||
f.write_str(" px")
|
||||
}
|
||||
}
|
||||
|
||||
impl CSSPixelLength {
|
||||
/// Return a new CSSPixelLength.
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue