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
|
||||
* - undoStates stores the states that can be undone
|
||||
* - redoStates stores the states that can be redone
|
||||
|
@ -382,7 +382,7 @@ const LayerList = (() => {
|
||||
Layer.layerOptions.style.top = "0";
|
||||
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.endCoords = getColourCoordinates(index);
|
||||
}
|
||||
else if (mouseEvent.which == 1) {
|
||||
endRampSelection(mouseEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/** Updates the outline for the current selection.
|
||||
|
@ -21,7 +21,7 @@ const Settings = (() => {
|
||||
enableDynamicCursorOutline: true, //unused - performance
|
||||
enableBrushPreview: true, //unused - performance
|
||||
enableEyedropperPreview: true, //unused - performance
|
||||
numberOfHistoryStates: 20,
|
||||
numberOfHistoryStates: 256,
|
||||
maxColorsOnImportedImage: 128,
|
||||
pixelGridColour: '#000000'
|
||||
};
|
||||
|
@ -186,23 +186,16 @@ class Layer {
|
||||
this.canvas.style.top = otherLayer.canvas.style.top;
|
||||
}
|
||||
|
||||
selectLayer(layer) {
|
||||
if (layer == null) {
|
||||
// Deselecting the old layer
|
||||
currFile.currentLayer.deselectLayer();
|
||||
selectLayer(hideOptions = true) {
|
||||
if (hideOptions)
|
||||
LayerList.closeOptionsMenu();
|
||||
// Deselecting the old layer
|
||||
currFile.currentLayer.deselectLayer();
|
||||
|
||||
// Selecting the current layer
|
||||
this.isSelected = true;
|
||||
this.menuEntry.classList.add("selected-layer");
|
||||
currFile.currentLayer = LayerList.getLayerByName(this.menuEntry.getElementsByTagName("p")[0].innerHTML);
|
||||
}
|
||||
else {
|
||||
currFile.currentLayer.deselectLayer();
|
||||
|
||||
layer.isSelected = true;
|
||||
layer.menuEntry.classList.add("selected-layer");
|
||||
currFile.currentLayer = layer;
|
||||
}
|
||||
// Selecting the current layer
|
||||
this.isSelected = true;
|
||||
this.menuEntry.classList.add("selected-layer");
|
||||
currFile.currentLayer = this;
|
||||
}
|
||||
|
||||
toggleLock() {
|
||||
|
Loading…
Reference in New Issue
Block a user