From 9f24ca036990c4fdaa178bc1a53e39836e838130 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 15 Feb 2019 17:20:18 -0300 Subject: [PATCH] Add Selection.origin setter --- scripts/selection.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/selection.lua b/scripts/selection.lua index 529a6e6b8..2b0cd8249 100644 --- a/scripts/selection.lua +++ b/scripts/selection.lua @@ -40,6 +40,12 @@ do -- Constructor with rectangles local b = Selection(1, 2, 3, 4) assert(b.bounds == Rectangle(1, 2, 3, 4)) + assert(b.origin == Point(1, 2)) + + -- Move + b.origin = Point(5, 6) + assert(b.bounds == Rectangle(5, 6, 3, 4)) + assert(b.origin == Point(5, 6)) end -- Sprite Selection @@ -62,6 +68,9 @@ do assert(sel.bounds.y == 3) assert(sel.bounds.width == 4) assert(sel.bounds.height == 5) + + sel.origin = Point(5, 6) + assert(sel.bounds == Rectangle(5, 6, 4, 5)) end -- Comparison