Rename app.toolStroke() -> app.useTool()

This commit is contained in:
David Capello 2019-03-23 13:53:44 -03:00
parent 8e378c4e45
commit aa4b9d91f3

View File

@ -27,19 +27,19 @@ assert(cel.bounds == Rectangle(0, 0, 4, 4))
-- pencil and eraser -- pencil and eraser
---------------------------------------------------------------------- ----------------------------------------------------------------------
app.toolStroke{ app.useTool{
tool='pencil', tool='pencil',
color=Color{ r=0, g=0, b=0 }, color=Color{ r=0, g=0, b=0 },
points={ Point(2, 2), points={ Point(2, 2),
Point(3, 2) }} Point(3, 2) }}
assert(cel.bounds == Rectangle(2, 2, 2, 1)) assert(cel.bounds == Rectangle(2, 2, 2, 1))
app.toolStroke{ app.useTool{
tool='eraser', tool='eraser',
points={ Point(2, 2) }} points={ Point(2, 2) }}
assert(cel.bounds == Rectangle(3, 2, 1, 1)) assert(cel.bounds == Rectangle(3, 2, 1, 1))
app.toolStroke{ app.useTool{
tool='eraser', tool='eraser',
points={ Point(3, 2) }} points={ Point(3, 2) }}
-- This must fail because cel is pointing to an invalid cel now. -- This must fail because cel is pointing to an invalid cel now.
@ -53,7 +53,7 @@ assert(not pcall(function() print(cel.bounds) end))
---------------------------------------------------------------------- ----------------------------------------------------------------------
local red = Color{ r=255, g=0, b=0 } local red = Color{ r=255, g=0, b=0 }
app.toolStroke{ app.useTool{
tool='line', tool='line',
color=red, color=red,
points={ Point(0, 0), Point(3, 3) }} points={ Point(0, 0), Point(3, 3) }}
@ -79,7 +79,7 @@ end
-- paint_bucket -- paint_bucket
---------------------------------------------------------------------- ----------------------------------------------------------------------
app.toolStroke{ app.useTool{
tool='paint_bucket', tool='paint_bucket',
color=red, color=red,
points={ Point(3, 0) }} points={ Point(3, 0) }}
@ -105,7 +105,7 @@ end
---------------------------------------------------------------------- ----------------------------------------------------------------------
local blue = Color{ r=0, g=0, b=255 } local blue = Color{ r=0, g=0, b=255 }
app.toolStroke{ app.useTool{
tool='rectangle', tool='rectangle',
color=blue, color=blue,
points={ Point(0, 0), Point(3, 3) }} points={ Point(0, 0), Point(3, 3) }}
@ -132,7 +132,7 @@ end
---------------------------------------------------------------------- ----------------------------------------------------------------------
local yellow = Color{ r=255, g=255, b=0 } local yellow = Color{ r=255, g=255, b=0 }
app.toolStroke{ app.useTool{
tool='ellipse', tool='ellipse',
color=yellow, color=yellow,
points={ Point(0, 0), Point(3, 3) }} points={ Point(0, 0), Point(3, 3) }}