Add some app.drawWithTool() basic tests

This commit is contained in:
David Capello 2019-03-15 17:04:19 -03:00
parent 9f24ca0369
commit 0df118e405

20
scripts/tools.lua Normal file
View File

@ -0,0 +1,20 @@
-- Copyright (C) 2019 Igara Studio S.A.
--
-- This file is released under the terms of the MIT license.
-- Read LICENSE.txt for more information.
local spr = Sprite(4, 4)
local cel = spr.cels[1]
assert(cel.bounds == Rectangle(0, 0, 4, 4))
app.drawWithTool{
tool='pencil',
color=Color{ r=0, g=0, b=0 },
points={ Point(2, 2),
Point(3, 2) }}
assert(cel.bounds == Rectangle(2, 2, 2, 1))
app.drawWithTool{
tool='eraser',
points={ Point(2, 2) }}
assert(cel.bounds == Rectangle(3, 2, 1, 1))