mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-10 00:36:52 +00:00
41 lines
821 B
JavaScript
41 lines
821 B
JavaScript
// Copyright (C) 2018 David Capello
|
|
//
|
|
// This file is released under the terms of the MIT license.
|
|
// Read LICENSE.txt for more information.
|
|
|
|
var s = new Sprite(16, 32)
|
|
console.assert(s.width == 16)
|
|
console.assert(s.height == 32)
|
|
|
|
s.width = 20
|
|
console.assert(s.width == 20)
|
|
console.assert(s.height == 32)
|
|
|
|
s.height = 40
|
|
console.assert(s.width == 20)
|
|
console.assert(s.height == 40)
|
|
|
|
app.undo()
|
|
console.assert(s.width == 20)
|
|
console.assert(s.height == 32)
|
|
|
|
app.undo()
|
|
console.assert(s.width == 16)
|
|
console.assert(s.height == 32)
|
|
|
|
app.transaction(
|
|
function() {
|
|
s.width = 20
|
|
s.height = 40
|
|
})
|
|
console.assert(s.width == 20)
|
|
console.assert(s.height == 40)
|
|
|
|
app.undo()
|
|
console.assert(s.width == 16)
|
|
console.assert(s.height == 32)
|
|
|
|
app.redo()
|
|
console.assert(s.width == 20)
|
|
console.assert(s.height == 40)
|