From b298105db0ac566b378ac132bfa719428b167a2a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 8 Aug 2025 07:41:54 +0530 Subject: [PATCH] Fix gl_pos* functions for negative positions --- kitty/graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/graphics.h b/kitty/graphics.h index 338547333..c5b8642b3 100644 --- a/kitty/graphics.h +++ b/kitty/graphics.h @@ -171,13 +171,13 @@ gl_size(const unsigned int sz, const unsigned int viewport_size) { } static inline float -gl_pos_x(const unsigned int px_from_left_margin, const unsigned int viewport_size) { +gl_pos_x(const int px_from_left_margin, const unsigned int viewport_size) { const float px = 2.f / viewport_size; return -1.f + px_from_left_margin * px; } static inline float -gl_pos_y(const unsigned int px_from_top_margin, const unsigned int viewport_size) { +gl_pos_y(const int px_from_top_margin, const unsigned int viewport_size) { const float px = 2.f / viewport_size; return 1.f - px_from_top_margin * px; }