mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added layer move
The user can now move layers and choose which one to put on top of each other just by dragging and dropping them in the layer menu. Also fixed a bug in the eyedropper, that can now pick a colour even though the layer it's on is not selected.
This commit is contained in:
@ -1,10 +1,22 @@
|
||||
function newPixel (width, height, palette) {
|
||||
layerList = document.getElementById("layers-menu");
|
||||
layerListEntry = layerList.firstElementChild;
|
||||
let firstPixel = true;
|
||||
|
||||
function newPixel (width, height, palette) {
|
||||
if (firstPixel) {
|
||||
layerList = document.getElementById("layers-menu");
|
||||
layerListEntry = layerList.firstElementChild;
|
||||
|
||||
firstPixel = false;
|
||||
}
|
||||
else {
|
||||
// TODO: clean layers before creating a new pixel
|
||||
// Devo togliere tutte le entries tranne la prima
|
||||
// Devo pulire la preview della prima entry
|
||||
// Devo cancellare tutte le tele tranne quella con id pixel-canvas
|
||||
}
|
||||
|
||||
console.log("Layer entry: " + layerListEntry);
|
||||
// Setting up the current layer
|
||||
currentLayer = new Layer(width, height, canvas, layerListEntry);
|
||||
canvas.style.zIndex = 2;
|
||||
|
||||
// Cloning the entry so that when I change something on the first layer, those changes aren't
|
||||
// propagated to the other ones
|
||||
|
Reference in New Issue
Block a user