Fix previews being right aligned

This commit is contained in:
Kovid Goyal
2025-10-09 09:03:09 +05:30
parent ceb712f791
commit 4ec94c786d

View File

@@ -228,7 +228,8 @@ func (self *GraphicsHandler) place_image(lp *loop.Loop, x, y, px_width int, sz S
self.has_placements = true
gc := self.new_graphics_command()
gc.SetAction(graphics.GRT_action_display).SetImageId(self.image_transmitted).SetPlacementId(1).SetCursorMovement(graphics.GRT_cursor_static)
if extra := px_width - self.last_rendered_image.image_width; extra > 0 {
if extra := px_width - self.last_rendered_image.image_width; extra > 1 {
extra /= 2
x += extra / sz.cell_width
gc.SetXOffset(uint64(extra % sz.cell_width))
}