From a97de9c1a4dfe7c11e7ddc8ae4a825ec816feba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20H=C3=A4user?= <8659494+mhaeuser@users.noreply.github.com> Date: Sat, 1 May 2021 17:18:45 +0200 Subject: [PATCH] OpenCanopy: Fix incorrect cursor crop code --- Platform/OpenCanopy/OpenCanopy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Platform/OpenCanopy/OpenCanopy.c b/Platform/OpenCanopy/OpenCanopy.c index af693cda..27bb1221 100644 --- a/Platform/OpenCanopy/OpenCanopy.c +++ b/Platform/OpenCanopy/OpenCanopy.c @@ -639,27 +639,27 @@ GuiOverlayPointer ( // BaseX = (INT64) PointerPos.Pos.X - BOOT_CURSOR_OFFSET * DrawContext->Scale; + MaxWidth = DrawContext->Screen.Width; if (BaseX < 0) { ImageOffsetX = (UINT32) -BaseX; DrawBaseX = 0; } else { ImageOffsetX = 0; DrawBaseX = (UINT32) BaseX; + MaxWidth -= DrawBaseX; } - MaxWidth = MIN (CursorImage->Width, (UINT32) (DrawContext->Screen.Width - BaseX)); - BaseY = (INT64) PointerPos.Pos.Y - BOOT_CURSOR_OFFSET * DrawContext->Scale; + MaxHeight = DrawContext->Screen.Height; if (BaseY < 0) { ImageOffsetY = (UINT32) -BaseY; DrawBaseY = 0; } else { ImageOffsetY = 0; DrawBaseY = (UINT32) BaseY; + MaxHeight -= DrawBaseY; } - MaxHeight = MIN (CursorImage->Height, (UINT32) (DrawContext->Screen.Height - BaseY)); - GuiDrawToBuffer ( CursorImage, DrawContext->CursorOpacity,