From c81a7937e9e882d0fee7b4cb1af98e18123fc64d Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 13 Aug 2019 18:26:15 -0300 Subject: [PATCH] Extra checks for Sprite:resize() --- scripts/sprite.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/sprite.lua b/scripts/sprite.lua index d275e511a..01823ed0a 100644 --- a/scripts/sprite.lua +++ b/scripts/sprite.lua @@ -16,14 +16,18 @@ do a:crop() assert(a.width == 4) assert(a.height == 5) + assert(a.cels[1].image.width == 32) + assert(a.cels[1].image.height == 64) a:resize(6, 8) assert(a.width == 6) assert(a.height == 8) + assert(a.cels[1].image.width == 32 * 6 / 4) -- Check that the image was resized (not only the canvas) + assert(a.cels[1].image.height == 64 * 8 / 5) a:crop{x=-1, y=-1, width=20, height=30} assert(a.width == 20) assert(a.height == 30) - -- Resize sprite setting width/height + -- Resize sprite setting width/height (just changing canvas size) a.width = 8 a.height = 10 assert(a.width == 8)