add a comment explaining the purpose of the function

This commit is contained in:
Kovid Goyal
2023-06-22 19:40:08 +05:30
parent 248301f8b3
commit 9415a56b0f

View File

@@ -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;