summaryrefslogtreecommitdiff
path: root/library/src/layout
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-31 16:31:21 +0200
committerLaurenz <laurmaedje@gmail.com>2023-03-31 16:33:33 +0200
commit5f97e0a77348d4fb1c89a9adf671647f1fa86dc3 (patch)
tree2800a61d06ac7cae8e57cb361804c530b1843bb8 /library/src/layout
parent00f11ae56d6d20b92a8c6ad6f2245c3ad3e94d86 (diff)
Make `Paint` not implement `Copy`
Diffstat (limited to 'library/src/layout')
-rw-r--r--library/src/layout/container.rs8
-rw-r--r--library/src/layout/page.rs4
-rw-r--r--library/src/layout/table.rs6
3 files changed, 12 insertions, 6 deletions
diff --git a/library/src/layout/container.rs b/library/src/layout/container.rs
index ef7def7a..bac0cb7f 100644
--- a/library/src/layout/container.rs
+++ b/library/src/layout/container.rs
@@ -383,7 +383,13 @@ impl Layout for BlockElem {
let outset = self.outset(styles);
let radius = self.radius(styles);
for frame in frames.iter_mut().skip(skip as usize) {
- frame.fill_and_stroke(fill, stroke, outset, radius, self.span());
+ frame.fill_and_stroke(
+ fill.clone(),
+ stroke.clone(),
+ outset,
+ radius,
+ self.span(),
+ );
}
}
diff --git a/library/src/layout/page.rs b/library/src/layout/page.rs
index 66d2bcc0..8ad85c79 100644
--- a/library/src/layout/page.rs
+++ b/library/src/layout/page.rs
@@ -362,8 +362,8 @@ impl PageElem {
}
}
- if let Some(fill) = fill {
- frame.fill(fill);
+ if let Some(fill) = &fill {
+ frame.fill(fill.clone());
}
}
diff --git a/library/src/layout/table.rs b/library/src/layout/table.rs
index 3b1f7247..d4238839 100644
--- a/library/src/layout/table.rs
+++ b/library/src/layout/table.rs
@@ -167,14 +167,14 @@ impl Layout for TableElem {
// Add lines and backgrounds.
for (frame, rows) in layout.fragment.iter_mut().zip(&layout.rows) {
// Render table lines.
- if let Some(stroke) = stroke {
+ if let Some(stroke) = &stroke {
let thickness = stroke.thickness;
let half = thickness / 2.0;
// Render horizontal lines.
for offset in points(rows.iter().map(|piece| piece.height)) {
let target = Point::with_x(frame.width() + thickness);
- let hline = Geometry::Line(target).stroked(stroke);
+ let hline = Geometry::Line(target).stroked(stroke.clone());
frame.prepend(
Point::new(-half, offset),
FrameItem::Shape(hline, self.span()),
@@ -184,7 +184,7 @@ impl Layout for TableElem {
// Render vertical lines.
for offset in points(layout.cols.iter().copied()) {
let target = Point::with_y(frame.height() + thickness);
- let vline = Geometry::Line(target).stroked(stroke);
+ let vline = Geometry::Line(target).stroked(stroke.clone());
frame.prepend(
Point::new(offset, -half),
FrameItem::Shape(vline, self.span()),