From 120fe63c0f112ce7d9aba3383c7072ea8feb5ac6 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 25 Jul 2021 12:35:03 -0400 Subject: [PATCH] [client] egl: keep x/y coordinates of cursor rectangle non-negative This shifts the rectangles upwards instead of cutting off the rectangles, but it keeps the code simple. --- client/renderers/EGL/cursor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/renderers/EGL/cursor.c b/client/renderers/EGL/cursor.c index dba3dd69..b3a3ee32 100644 --- a/client/renderers/EGL/cursor.c +++ b/client/renderers/EGL/cursor.c @@ -26,6 +26,7 @@ #include "texture.h" #include "shader.h" #include "model.h" +#include "util.h" #include #include @@ -332,6 +333,9 @@ struct CursorState egl_cursor_render(EGL_Cursor * cursor, LG_RendererRotate rota assert(!"unreachable"); } + state.rect.x = max(0, state.rect.x); + state.rect.y = max(0, state.rect.y); + glEnable(GL_BLEND); switch(cursor->type) {