From a4f2f1b6018be172a72b4d6cf52265099b8de4ce Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jun 2023 21:10:23 +0530 Subject: [PATCH] DRYer --- kitty/graphics.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty/graphics.c b/kitty/graphics.c index 588fb3038..9b3e15448 100644 --- a/kitty/graphics.c +++ b/kitty/graphics.c @@ -901,8 +901,9 @@ handle_put_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c, b static void set_vertex_data(ImageRenderData *rd, const ImageRef *ref, const ImageRect *dest_rect) { -#define R(n, a, b) rd->vertices[n*4] = ref->src_rect.a; rd->vertices[n*4 + 1] = ref->src_rect.b; rd->vertices[n*4 + 2] = dest_rect->a; rd->vertices[n*4 + 3] = dest_rect->b; - R(0, right, top); R(1, right, bottom); R(2, left, bottom); R(3, left, top); + unsigned n = 0; +#define R(a, b) rd->vertices[n*4] = ref->src_rect.a; rd->vertices[n*4 + 1] = ref->src_rect.b; rd->vertices[n*4 + 2] = dest_rect->a; rd->vertices[n*4 + 3] = dest_rect->b; n++; + R(right, top); R(right, bottom); R(left, bottom); R(left, top); #undef R }