Fixed sprite scaling history bug

This commit is contained in:
unsettledgames
2021-04-29 12:50:59 +02:00
parent 26aa1023c5
commit 6e483710f0
7 changed files with 7 additions and 19 deletions

View File

@@ -114,7 +114,7 @@ function resizeCanvas(event, size, customData, saveHistory = true) {
}
// Saving the history only if I'm not already undoing or redoing
if (saveHistory) {
if (saveHistory && event != null) {
// Saving history
new HistoryStateResizeCanvas(
{x: parseInt(layers[0].canvasSize[0]) + rcBorders.left + rcBorders.right,
@@ -194,9 +194,6 @@ function resizeCanvas(event, size, customData, saveHistory = true) {
layers[i].context.putImageData(imageDatas[copiedDataIndex], leftOffset, topOffset);
}
else {
console.log("sgancio " + layers[i].canvasSize + ", [" +
customData[copiedDataIndex].width + "," + customData[copiedDataIndex].height
+ "]");
layers[i].context.putImageData(customData[copiedDataIndex], 0, 0);
}
layers[i].updateLayerPreview();