From 0ffb52fcac55f1719048b8f88b457fbf0547057a Mon Sep 17 00:00:00 2001 From: MrCdK Date: Thu, 5 May 2016 18:38:50 +0200 Subject: [PATCH] Fix Image.copyPixels() with negative dest It was setting the source rect x and y to the dest x and y and not subtracting it. --- lime/graphics/Image.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lime/graphics/Image.hx b/lime/graphics/Image.hx index f587a63ea..59d0e0453 100644 --- a/lime/graphics/Image.hx +++ b/lime/graphics/Image.hx @@ -300,12 +300,12 @@ class Image { //draw area starts too far left or too far above destination image boundaries if (destPoint.x < 0) { sourceRect.width += destPoint.x; //shrink width by amount off canvas - sourceRect.x = -destPoint.x; //adjust source rect to effective starting point + sourceRect.x -= destPoint.x; //adjust source rect to effective starting point destPoint.x = 0; //clamp destination point to 0 } if (destPoint.y < 0) { sourceRect.height += destPoint.y; //shrink height by amount off canvas - sourceRect.y = -destPoint.y; //adjust source rect to effective starting point + sourceRect.y -= destPoint.y; //adjust source rect to effective starting point destPoint.y = 0; //clamp destination point to 0 }