Removed all global variables, worked on File class and put canvas resizing functions in File

This commit is contained in:
unsettledgames
2021-12-06 17:37:43 +01:00
parent d972f9c530
commit b2f5521750
32 changed files with 668 additions and 704 deletions

View File

@ -21,7 +21,7 @@ const EditorState = (() => {
document.getElementById("switch-mode-button").innerHTML = 'Switch to basic mode';
//turn pixel grid off
pixelGrid.togglePixelGrid('off');
currFile.pixelGrid.togglePixelGrid('off');
}
//switch to basic mode
else {
@ -32,7 +32,7 @@ const EditorState = (() => {
}
// Selecting the current layer
currentLayer.selectLayer();
currFile.currentLayer.selectLayer();
// Flatten the layers
LayerList.flatten(true);
}
@ -47,7 +47,7 @@ const EditorState = (() => {
pixelEditorMode = 'Basic';
document.getElementById("switch-mode-button").innerHTML = 'Switch to advanced mode';
pixelGrid.togglePixelGrid('on');
currFile.pixelGrid.togglePixelGrid('on');
}
}