Fixed data handling bug

When updating a percentage, it based it off the previous edited value (eg if I scale 2x, old value will be equal to 2x, so if you wanted to scale it 0.5x, it actually made it 4x times smaller)
This commit is contained in:
unsettledgames
2020-09-22 12:29:58 +02:00
parent b595026ea8
commit 29f8baf627
4 changed files with 52 additions and 22 deletions

View File

@@ -3,6 +3,22 @@ var redoStates = [];
const undoLogStyle = 'background: #87ff1c; color: black; padding: 5px;';
function HistoryStateResizeSprite(newPercs, oldPercs, algo) {
this.newPercs = newPercs;
this.oldPercs = oldPercs;
this.algo = algo;
this.undo = function() {
};
this.redo = function() {
};
saveHistoryState(this);
}
function HistoryStateResizeCanvas(newSize, oldSize, imageDatas) {
this.oldSize = oldSize;
this.newSize = newSize;