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 = [];
|
canvasSize = [];
|
||||||
zoom = 7;
|
zoom = 7;
|
||||||
canvasView = document.getElementById("canvas-view");
|
canvasView = document.getElementById("canvas-view");
|
||||||
|
inited = false;
|
||||||
|
|
||||||
// Layers
|
// Layers
|
||||||
layers = [];
|
layers = [];
|
||||||
@ -34,11 +35,13 @@ class File {
|
|||||||
// Start resize data
|
// Start resize data
|
||||||
startData = {width: 0, height:0, widthPercentage: 100, heightPercentage: 100};
|
startData = {width: 0, height:0, widthPercentage: 100, heightPercentage: 100};
|
||||||
|
|
||||||
// Sprite scaling attributes
|
|
||||||
|
|
||||||
openResizeCanvasWindow() {
|
openResizeCanvasWindow() {
|
||||||
// Initializes the inputs
|
if (!this.inited) {
|
||||||
this.initResizeCanvasInputs();
|
this.initResizeCanvasInputs();
|
||||||
|
this.inited = true;
|
||||||
|
}
|
||||||
|
// Initializes the inputs
|
||||||
Dialogue.showDialogue('resize-canvas');
|
Dialogue.showDialogue('resize-canvas');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +154,9 @@ class File {
|
|||||||
currFile.canvasSize[1] = parseInt(currFile.canvasSize[1]) +
|
currFile.canvasSize[1] = parseInt(currFile.canvasSize[1]) +
|
||||||
this.rcBorders.top + this.rcBorders.bottom;
|
this.rcBorders.top + this.rcBorders.bottom;
|
||||||
|
|
||||||
|
console.trace();
|
||||||
|
console.log(currFile.canvasSize);
|
||||||
|
|
||||||
// Resize the canvases
|
// Resize the canvases
|
||||||
for (let i=0; i<currFile.layers.length; i++) {
|
for (let i=0; i<currFile.layers.length; i++) {
|
||||||
currFile.layers[i].canvas.width = currFile.canvasSize[0];
|
currFile.layers[i].canvas.width = currFile.canvasSize[0];
|
||||||
|
@ -36,7 +36,6 @@ const ToolManager = (() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onMouseWheel(mouseEvent) {
|
function onMouseWheel(mouseEvent) {
|
||||||
console.log("MOUSE WHEEL");
|
|
||||||
if (!EditorState.documentCreated || Dialogue.isOpen())
|
if (!EditorState.documentCreated || Dialogue.isOpen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user