mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
parent
a238fb1b47
commit
1bac62be4c
@ -1,15 +1,3 @@
|
|||||||
/** BUG:
|
|
||||||
* - Create a new pixel
|
|
||||||
* - Open a png file
|
|
||||||
* - Draw with the pencil
|
|
||||||
* - Hit CTRL+Z
|
|
||||||
* - RESULT: undo doesn't work, the app can't find the current layer
|
|
||||||
*
|
|
||||||
* - RELATED: when opening an LPE file, the app draws on a layer that is below the one in which the
|
|
||||||
* file is loaded. This is because the data is loaded on new layers, but the first one
|
|
||||||
* isn't removed and sometimes it could have the same ID of a recently added layer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** How the history works
|
/** How the history works
|
||||||
* - undoStates stores the states that can be undone
|
* - undoStates stores the states that can be undone
|
||||||
* - redoStates stores the states that can be redone
|
* - redoStates stores the states that can be redone
|
||||||
|
@ -382,7 +382,7 @@ const LayerList = (() => {
|
|||||||
Layer.layerOptions.style.top = "0";
|
Layer.layerOptions.style.top = "0";
|
||||||
Layer.layerOptions.style.marginTop = "" + (event.clientY - 25) + "px";
|
Layer.layerOptions.style.marginTop = "" + (event.clientY - 25) + "px";
|
||||||
|
|
||||||
getLayerByID(selectedId).selectLayer();
|
getLayerByID(selectedId).selectLayer(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +131,9 @@ const PaletteBlock = (() => {
|
|||||||
currentSelection.startCoords = getColourCoordinates(index);
|
currentSelection.startCoords = getColourCoordinates(index);
|
||||||
currentSelection.endCoords = getColourCoordinates(index);
|
currentSelection.endCoords = getColourCoordinates(index);
|
||||||
}
|
}
|
||||||
|
else if (mouseEvent.which == 1) {
|
||||||
|
endRampSelection(mouseEvent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Updates the outline for the current selection.
|
/** Updates the outline for the current selection.
|
||||||
|
@ -21,7 +21,7 @@ const Settings = (() => {
|
|||||||
enableDynamicCursorOutline: true, //unused - performance
|
enableDynamicCursorOutline: true, //unused - performance
|
||||||
enableBrushPreview: true, //unused - performance
|
enableBrushPreview: true, //unused - performance
|
||||||
enableEyedropperPreview: true, //unused - performance
|
enableEyedropperPreview: true, //unused - performance
|
||||||
numberOfHistoryStates: 20,
|
numberOfHistoryStates: 256,
|
||||||
maxColorsOnImportedImage: 128,
|
maxColorsOnImportedImage: 128,
|
||||||
pixelGridColour: '#000000'
|
pixelGridColour: '#000000'
|
||||||
};
|
};
|
||||||
|
@ -186,23 +186,16 @@ class Layer {
|
|||||||
this.canvas.style.top = otherLayer.canvas.style.top;
|
this.canvas.style.top = otherLayer.canvas.style.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
selectLayer(layer) {
|
selectLayer(hideOptions = true) {
|
||||||
if (layer == null) {
|
if (hideOptions)
|
||||||
// Deselecting the old layer
|
LayerList.closeOptionsMenu();
|
||||||
currFile.currentLayer.deselectLayer();
|
// Deselecting the old layer
|
||||||
|
currFile.currentLayer.deselectLayer();
|
||||||
|
|
||||||
// Selecting the current layer
|
// Selecting the current layer
|
||||||
this.isSelected = true;
|
this.isSelected = true;
|
||||||
this.menuEntry.classList.add("selected-layer");
|
this.menuEntry.classList.add("selected-layer");
|
||||||
currFile.currentLayer = LayerList.getLayerByName(this.menuEntry.getElementsByTagName("p")[0].innerHTML);
|
currFile.currentLayer = this;
|
||||||
}
|
|
||||||
else {
|
|
||||||
currFile.currentLayer.deselectLayer();
|
|
||||||
|
|
||||||
layer.isSelected = true;
|
|
||||||
layer.menuEntry.classList.add("selected-layer");
|
|
||||||
currFile.currentLayer = layer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleLock() {
|
toggleLock() {
|
||||||
|
Loading…
Reference in New Issue
Block a user