X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fanim.c;fp=src%2Fanim.c;h=363c76fc7197d4c74e17f7dcf74210f38fe2e7eb;hp=e603a9d38a0e3760e616a83f623db24c2aac39d1;hb=2aaf015a5b6264a47dd1da84ee2de1164752e9c2;hpb=b2fbe97bd09c91e5efb580b35b910a3709015421 diff --git a/src/anim.c b/src/anim.c index e603a9d3..363c76fc 100644 --- a/src/anim.c +++ b/src/anim.c @@ -880,6 +880,11 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part int mx = MIN(MAX(0, gfx.mouse_x), WIN_XSIZE - 1); int my = MIN(MAX(0, gfx.mouse_y), WIN_YSIZE - 1); + // prevent displaying off-screen custom mouse cursor in upper left corner + if (gfx.mouse_x == POS_OFFSCREEN && + gfx.mouse_y == POS_OFFSCREEN) + mx = my = POS_OFFSCREEN; + viewport_x = mx - part->control_info.x; viewport_y = my - part->control_info.y; viewport_width = part->graphic_info.width;