mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
commit
ebc6cf0dab
10
js/File.js
10
js/File.js
@ -3,6 +3,7 @@ class File {
|
||||
canvasSize = [];
|
||||
zoom = 7;
|
||||
canvasView = document.getElementById("canvas-view");
|
||||
inited = false;
|
||||
|
||||
// Layers
|
||||
layers = [];
|
||||
@ -34,11 +35,13 @@ class File {
|
||||
// Start resize data
|
||||
startData = {width: 0, height:0, widthPercentage: 100, heightPercentage: 100};
|
||||
|
||||
// Sprite scaling attributes
|
||||
|
||||
openResizeCanvasWindow() {
|
||||
// Initializes the inputs
|
||||
if (!this.inited) {
|
||||
this.initResizeCanvasInputs();
|
||||
this.inited = true;
|
||||
}
|
||||
// Initializes the inputs
|
||||
Dialogue.showDialogue('resize-canvas');
|
||||
}
|
||||
|
||||
@ -151,6 +154,9 @@ class File {
|
||||
currFile.canvasSize[1] = parseInt(currFile.canvasSize[1]) +
|
||||
this.rcBorders.top + this.rcBorders.bottom;
|
||||
|
||||
console.trace();
|
||||
console.log(currFile.canvasSize);
|
||||
|
||||
// Resize the canvases
|
||||
for (let i=0; i<currFile.layers.length; i++) {
|
||||
currFile.layers[i].canvas.width = currFile.canvasSize[0];
|
||||
|
@ -36,7 +36,6 @@ const ToolManager = (() => {
|
||||
}
|
||||
|
||||
function onMouseWheel(mouseEvent) {
|
||||
console.log("MOUSE WHEEL");
|
||||
if (!EditorState.documentCreated || Dialogue.isOpen())
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user