diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/size.rs | 12 | ||||
| -rw-r--r-- | src/style.rs | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/size.rs b/src/size.rs index fac31625..50b3ace5 100644 --- a/src/size.rs +++ b/src/size.rs @@ -116,6 +116,12 @@ impl Size2D { Size2D::default() } + /// Create a 2D-size with `x` and `y` set to the same value `s`. + #[inline] + pub fn with_all(s: Size) -> Size2D { + Size2D { x: s, y: s } + } + /// Create a new 2D-size with `x` set to a value and `y` zero. #[inline] pub fn with_x(x: Size) -> Size2D { @@ -179,6 +185,12 @@ impl SizeBox { pub fn zero() -> SizeBox { SizeBox::default() } + + /// Create a box with all four fields set to the same value `s`. + #[inline] + pub fn with_all(s: Size) -> SizeBox { + SizeBox { left: s, top: s, right: s, bottom: s } + } } /// The maximum of two sizes. diff --git a/src/style.rs b/src/style.rs index da190b46..ae396852 100644 --- a/src/style.rs +++ b/src/style.rs @@ -65,10 +65,10 @@ impl Default for TextStyle { TextStyle { classes: vec![Regular], fallback: vec![Serif], - font_size: Size::pt(11.0), + font_size: Size::pt(10.0), word_spacing: 0.25, line_spacing: 1.2, - paragraph_spacing: 1.5, + paragraph_spacing: 1.4, } } } |
