summaryrefslogtreecommitdiff
path: root/src/paper.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-01 19:15:55 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-01 19:15:55 +0200
commit659248d52ff9e6be4dad7c4555bd62899671ad55 (patch)
tree610f382adc09524a08c5cbb941e46103117a88e5 /src/paper.rs
parent04c05502bee50f7657dc2d88c60eb935b068a284 (diff)
Raw lengths 🚲
Replace unitless length with raw f64 and introduce length type with unit.
Diffstat (limited to 'src/paper.rs')
-rw-r--r--src/paper.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/paper.rs b/src/paper.rs
index ba2dc212..eb059090 100644
--- a/src/paper.rs
+++ b/src/paper.rs
@@ -1,6 +1,7 @@
//! Predefined papers.
-use crate::length::{Length, Size, Value4, ScaleLength};
+use crate::geom::{Size, Value4};
+use crate::length::{Length, ScaleLength};
/// Specification of a paper.
#[derive(Debug, Copy, Clone, PartialEq)]
@@ -21,7 +22,7 @@ impl Paper {
/// The size of the paper.
pub fn size(self) -> Size {
- Size::new(self.width, self.height)
+ Size::new(self.width.as_raw(), self.height.as_raw())
}
}
@@ -74,8 +75,8 @@ macro_rules! papers {
#[doc = $names]
#[doc = "`."]
pub const $var: Paper = Paper {
- width: Length { points: 2.83465 * $width },
- height: Length { points: 2.83465 * $height },
+ width: Length::mm($width),
+ height: Length::mm($height),
class: PaperClass::$class,
};
};