mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Started project opening
Fixed a bug in the flatten visible undo, created an array to store the colours in the current palette, implemented project saving.
This commit is contained in:
@@ -25,20 +25,15 @@ function HistoryStateFlattenVisible(flattened) {
|
||||
saveHistoryState(this);
|
||||
}
|
||||
|
||||
function HistoryStateFlattenTwoVisibles(belowImageData, beforeAbove, layerIndex, aboveLayer, belowLayer) {
|
||||
function HistoryStateFlattenTwoVisibles(belowImageData, afterAbove, layerIndex, aboveLayer, belowLayer) {
|
||||
this.aboveLayer = aboveLayer;
|
||||
this.belowLayer = belowLayer;
|
||||
this.belowImageData = belowImageData;
|
||||
|
||||
this.undo = function() {
|
||||
// SCEMOOOO DEVI METTERCI PURE I PIXELSSSS
|
||||
console.log(afterAbove.menuEntry);
|
||||
canvasView.append(aboveLayer.canvas);
|
||||
if (beforeAbove != null) {
|
||||
layerList.insertBefore(aboveLayer.menuEntry, beforeAbove.menuEntry);
|
||||
}
|
||||
else {
|
||||
layerList.prepend(aboveLayer.menuEntry);
|
||||
}
|
||||
layerList.insertBefore(aboveLayer.menuEntry, afterAbove);
|
||||
|
||||
belowLayer.context.clearRect(0, 0, belowLayer.canvasSize[0], belowLayer.canvasSize[1]);
|
||||
belowLayer.context.putImageData(this.belowImageData, 0, 0);
|
||||
|
Reference in New Issue
Block a user