summaryrefslogtreecommitdiff
path: root/src/layout/actions.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/layout/actions.rs
parent04c05502bee50f7657dc2d88c60eb935b068a284 (diff)
Raw lengths 🚲
Replace unitless length with raw f64 and introduce length type with unit.
Diffstat (limited to 'src/layout/actions.rs')
-rw-r--r--src/layout/actions.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/layout/actions.rs b/src/layout/actions.rs
index 7806932e..89c10285 100644
--- a/src/layout/actions.rs
+++ b/src/layout/actions.rs
@@ -4,7 +4,7 @@ use std::fmt::{self, Debug, Formatter};
use serde::ser::{Serialize, Serializer, SerializeTuple};
use fontdock::FaceId;
-use crate::length::{Length, Size};
+use crate::geom::Size;
use super::Layout;
use self::LayoutAction::*;
@@ -15,7 +15,7 @@ pub enum LayoutAction {
/// Move to an absolute position.
MoveAbsolute(Size),
/// Set the font given the index from the font loader and font size.
- SetFont(FaceId, Length),
+ SetFont(FaceId, f64),
/// Write text at the current position.
WriteText(String),
/// Visualize a box for debugging purposes.
@@ -82,9 +82,9 @@ impl Debug for LayoutAction {
pub struct LayoutActions {
origin: Size,
actions: Vec<LayoutAction>,
- active_font: (FaceId, Length),
+ active_font: (FaceId, f64),
next_pos: Option<Size>,
- next_font: Option<(FaceId, Length)>,
+ next_font: Option<(FaceId, f64)>,
}
impl LayoutActions {
@@ -93,7 +93,7 @@ impl LayoutActions {
LayoutActions {
actions: vec![],
origin: Size::ZERO,
- active_font: (FaceId::MAX, Length::ZERO),
+ active_font: (FaceId::MAX, 0.0),
next_pos: None,
next_font: None,
}