Merge branch 'main' into beta

This commit is contained in:
David Capello 2022-07-14 15:19:41 -03:00
commit a4d730a734
4 changed files with 31 additions and 0 deletions

View File

@ -41,6 +41,21 @@ do -- NewSprite
assert(s2.colorMode == ColorMode.INDEXED)
end
do -- ExportSpriteSheet
local s = Sprite{ fromFile="sprites/2f-index-3x3.aseprite" }
app.command.ExportSpriteSheet {
type="horizontal",
textureFilename="_test_export_spritesheet1.png",
shapePadding=1
}
local i = Image{ fromFile="_test_export_spritesheet1.png" }
expect_img(i, {
11,8,11,21,8,11,11,
11,8,11,21,11,8,11,
11,8,11,21,11,11,8,
})
end
do -- NewLayer/RemoveLayer
local s = Sprite(32, 32)
assert(#s.layers == 1)

View File

@ -1,3 +1,4 @@
-- Copyright (C) 2022 Igara Studio S.A.
-- Copyright (C) 2018 David Capello
--
-- This file is released under the terms of the MIT license.
@ -13,14 +14,27 @@ do
assert(b.bounds == Rectangle(0, 2, 8, 10))
assert(c.bounds == Rectangle(0, 0, 32, 32))
local bounds = { nil, Rectangle(0, 2, 8, 10), Rectangle(0, 0, 32, 32) }
local i = 1
for k,v in ipairs(s.slices) do
assert(i == k)
assert(v == s.slices[k])
assert(bounds[i] == s.slices[k].bounds)
i = i+1
end
s:deleteSlice(b)
assert(a == s.slices[1])
assert(c == s.slices[2])
assert(2 == #s.slices)
app.undo()
assert(3 == #s.slices)
app.undo()
assert(2 == #s.slices)
app.undo()
assert(1 == #s.slices)
app.undo()
assert(0 == #s.slices)
end

Binary file not shown.

View File

@ -23,3 +23,5 @@
content as in `point4frames.aseprite`. Useful to test if
`"sourceSize"` is different when two cels from different sprites are
merged in the same texture atlas.
* `2f-index-3x3.aseprite`: Indexed, 2 frames, 1 layer, mask color set
to index 21.