summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-02-17 11:55:28 +0100
committerLaurenz <laurmaedje@gmail.com>2022-02-17 13:28:04 +0100
commitab95627d873239182e7b28b266f8b9f9da5cdbb1 (patch)
treeae6589d60d32a7ae884326911600c733dc32d977 /src/layout
parent5965515a1ef1fe398235311185d531efc2750247 (diff)
Switch to const generics for nodes
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 7755f84c..c334433e 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -18,9 +18,9 @@ use std::sync::Arc;
use crate::eval::StyleChain;
use crate::font::FontStore;
use crate::frame::{Element, Frame, Geometry, Shape, Stroke};
-use crate::geom::{Align, Linear, Paint, Point, Sides, Size, Spec};
+use crate::geom::{Align, Linear, Paint, Point, Sides, Size, Spec, Transform};
use crate::image::ImageStore;
-use crate::library::{AlignNode, Move, PadNode, TransformNode};
+use crate::library::{AlignNode, PadNode, TransformNode, MOVE};
use crate::util::Prehashed;
use crate::Context;
@@ -150,8 +150,8 @@ impl LayoutNode {
/// Transform this node's contents without affecting layout.
pub fn moved(self, offset: Point) -> Self {
if !offset.is_zero() {
- TransformNode {
- kind: Move(offset.x, offset.y),
+ TransformNode::<MOVE> {
+ transform: Transform::translation(offset.x, offset.y),
child: self,
}
.pack()