diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-16 17:36:04 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-17 11:30:58 +0100 |
| commit | e8435df5ec718e8ecc8a2ad48e4eb3ddd1f92a72 (patch) | |
| tree | 58d8356ec1c615f898e342a479b5f967a8177468 /library/src/layout | |
| parent | ecb5543985cc0788d9c01e8c2e28d8ca6d8e19b6 (diff) | |
More jump targets
Diffstat (limited to 'library/src/layout')
| -rw-r--r-- | library/src/layout/container.rs | 4 | ||||
| -rw-r--r-- | library/src/layout/table.rs | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/library/src/layout/container.rs b/library/src/layout/container.rs index 009063f0..a48933a7 100644 --- a/library/src/layout/container.rs +++ b/library/src/layout/container.rs @@ -141,7 +141,7 @@ impl Layout for BoxNode { if fill.is_some() || stroke.iter().any(Option::is_some) { let outset = self.outset(styles); let radius = self.radius(styles); - frame.fill_and_stroke(fill, stroke, outset, radius); + frame.fill_and_stroke(fill, stroke, outset, radius, self.span()); } // Apply metadata. @@ -383,7 +383,7 @@ impl Layout for BlockNode { 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); + frame.fill_and_stroke(fill, stroke, outset, radius, self.span()); } } diff --git a/library/src/layout/table.rs b/library/src/layout/table.rs index 012e63ac..6daafdbb 100644 --- a/library/src/layout/table.rs +++ b/library/src/layout/table.rs @@ -166,14 +166,20 @@ impl Layout for TableNode { 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); - frame.prepend(Point::new(-half, offset), Element::Shape(hline)); + frame.prepend( + Point::new(-half, offset), + Element::Shape(hline, self.span()), + ); } // 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); - frame.prepend(Point::new(offset, -half), Element::Shape(vline)); + frame.prepend( + Point::new(offset, -half), + Element::Shape(vline, self.span()), + ); } } @@ -186,7 +192,7 @@ impl Layout for TableNode { let pos = Point::new(dx, dy); let size = Size::new(col, row.height); let rect = Geometry::Rect(size).filled(fill); - frame.prepend(pos, Element::Shape(rect)); + frame.prepend(pos, Element::Shape(rect, self.span())); } dy += row.height; } |
