renderer: kitty image with y offset should stretch image

Fixes #1784

This was just a misunderstanding of the "spec." When both a y offset
into the image is specified and a height, the image should be stretched.
I mistakingly thought that the image should be offset (even with this
misunderstanding there was a data corruption bug).

This resolves the issue and output matches Kitty.
This commit is contained in:
Mitchell Hashimoto
2024-05-22 15:40:31 -04:00
parent 9ad598facf
commit 06bcbe868f
2 changed files with 2 additions and 2 deletions

View File

@ -1660,7 +1660,7 @@ fn prepKittyGraphics(
const source_height = if (p.source_height > 0)
@min(image.height, p.source_height)
else
image.height -| offset_y;
image.height -| source_y;
// Calculate the width/height of our image.
const dest_width = if (p.columns > 0) p.columns * self.grid_metrics.cell_width else source_width;

View File

@ -850,7 +850,7 @@ fn prepKittyGraphics(
const source_height = if (p.source_height > 0)
@min(image.height, p.source_height)
else
image.height -| offset_y;
image.height -| source_y;
// Calculate the width/height of our image.
const dest_width = if (p.columns > 0) p.columns * self.grid_metrics.cell_width else source_width;