From 4ec94c786dd31bf83b8cb3dc219be24dac8d524d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Oct 2025 09:03:09 +0530 Subject: [PATCH] Fix previews being right aligned --- kittens/choose_files/graphics.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kittens/choose_files/graphics.go b/kittens/choose_files/graphics.go index 3ee4f3634..9bdc1181c 100644 --- a/kittens/choose_files/graphics.go +++ b/kittens/choose_files/graphics.go @@ -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)) }