From 9415a56b0f8d463bdf637adcd49efae71c0f5534 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Jun 2023 19:40:08 +0530 Subject: [PATCH] add a comment explaining the purpose of the function --- kitty/graphics.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kitty/graphics.c b/kitty/graphics.c index 7aac385eb..47fdd5f79 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -901,6 +901,8 @@ handle_put_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c, b void scale_rendered_graphic(ImageRenderData *rd, float xstart, float ystart, float x_scale, float y_scale) { + // Scale the graphic so that it appears at the same position and size during a live resize + // this means scale factors are applied to both the position and size of the graphic. float width = rd->dest_rect.right - rd->dest_rect.left, height = rd->dest_rect.bottom - rd->dest_rect.top; rd->dest_rect.left = xstart + (rd->dest_rect.left - xstart) * x_scale; rd->dest_rect.right = rd->dest_rect.left + width * x_scale;