From 36c85bb54038ab3e82017264a2487c84d6e428ad Mon Sep 17 00:00:00 2001 From: Firew0lf Date: Mon, 28 Mar 2016 19:02:39 +0200 Subject: [PATCH] Fixed the screen.blit() offset with parts of images --- uCompat/screen.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uCompat/screen.lua b/uCompat/screen.lua index 6cfd080..464b2ec 100644 --- a/uCompat/screen.lua +++ b/uCompat/screen.lua @@ -135,7 +135,7 @@ function screen.blit(scr, x, y, img, sx, sy, w, h) local x = math.floor(x) local y = math.floor(y) local sizex, sizey = img.texture:getSize() - checkBuffer(scr)[#videoStack[scr]+1] = {"img", img.texture, {offsetX+x+math.floor(sizex/2), offsetY+y+math.floor(sizey/2), (sx or 0), (sy or 0), (w or sizex), (h or sizey), img.rotation}} + checkBuffer(scr)[#videoStack[scr]+1] = {"img", img.texture, {offsetX+x+math.floor((w or sizex)/2), offsetY+y+math.floor((h or sizey)/2), (sx or 0), (sy or 0), (w or sizex), (h or sizey), img.rotation}} end function screen.drawPoint(scr, x, y, color)