mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 13:32:27 +00:00
Add some app.drawWithTool() basic tests
This commit is contained in:
parent
9f24ca0369
commit
0df118e405
20
scripts/tools.lua
Normal file
20
scripts/tools.lua
Normal 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))
|
Loading…
Reference in New Issue
Block a user