Skip to content

Commit 28ef5ac

Browse files
committed
fix: use right size for footer images
1 parent a1476b1 commit 28ef5ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ui/footer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ impl FooterGenerator {
5353
]);
5454
}
5555

56-
fn push_image(&self, image: &Image, alignment: Alignment, operations: &mut Vec<RenderOperation>) {
56+
fn push_image(&self, image: &Image, alignment: Alignment, height: u16, operations: &mut Vec<RenderOperation>) {
5757
let mut properties = ImageRenderProperties::default();
5858

5959
operations.push(RenderOperation::ApplyMargin(MarginProperties {
6060
horizontal: Margin::Fixed(0),
61-
top: 0,
61+
top: 1,
6262
bottom: 1,
6363
}));
6464
match alignment {
@@ -73,7 +73,7 @@ impl FooterGenerator {
7373
};
7474
operations.extend([
7575
// Start printing the image at the top of the footer rect
76-
RenderOperation::JumpToRow { index: 0 },
76+
RenderOperation::JumpToBottomRow { index: height.saturating_sub(2) },
7777
RenderOperation::RenderImage(image.clone(), properties),
7878
RenderOperation::PopMargin,
7979
]);
@@ -105,7 +105,7 @@ impl AsRenderOperations for FooterGenerator {
105105
Self::render_line(line, alignment, *height, &mut operations);
106106
}
107107
RenderedFooterContent::Image(image) => {
108-
self.push_image(image, alignment, &mut operations);
108+
self.push_image(image, alignment, *height, &mut operations);
109109
}
110110
};
111111
}

0 commit comments

Comments
 (0)