mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed bug when loading an image
This commit is contained in:
parent
04afee2172
commit
ba969aeffb
@ -86,6 +86,6 @@ function createPaletteFromLayers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//create palette form colors array
|
//create palette from colors array
|
||||||
//createColorPalette(colorPaletteArray, false);
|
createColorPalette(colorPaletteArray, true);
|
||||||
}
|
}
|
@ -35,6 +35,7 @@ document.getElementById('open-image-browse-holder').addEventListener('change', f
|
|||||||
|
|
||||||
//draw the image onto the canvas
|
//draw the image onto the canvas
|
||||||
currentLayer.context.drawImage(img, 0, 0);
|
currentLayer.context.drawImage(img, 0, 0);
|
||||||
|
console.log("qui");
|
||||||
createPaletteFromLayers();
|
createPaletteFromLayers();
|
||||||
|
|
||||||
//track google event
|
//track google event
|
||||||
|
@ -154,7 +154,7 @@ function newPixel (width, height, editorMode, fileContent = null) {
|
|||||||
// This is not the first Pixel anymore
|
// This is not the first Pixel anymore
|
||||||
firstPixel = false;
|
firstPixel = false;
|
||||||
|
|
||||||
// Now, if I opened a file
|
// Now, if I opened an LPE file
|
||||||
if (fileContent != null) {
|
if (fileContent != null) {
|
||||||
// I add every layer the file had in it
|
// I add every layer the file had in it
|
||||||
for (let i=0; i<fileContent['nLayers']; i++) {
|
for (let i=0; i<fileContent['nLayers']; i++) {
|
||||||
@ -207,7 +207,7 @@ function newFromTemplate(preset, x, y) {
|
|||||||
if (preset != '') {
|
if (preset != '') {
|
||||||
setText('palette-button-splash', presets[preset].palette);
|
setText('palette-button-splash', presets[preset].palette);
|
||||||
setText('palette-button', presets[preset].palette);
|
setText('palette-button', presets[preset].palette);
|
||||||
|
|
||||||
x = presets[preset].width;
|
x = presets[preset].width;
|
||||||
y = presets[preset].height;
|
y = presets[preset].height;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user