mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-26 14:48:52 -03:00
Canvas always on top
This commit is contained in:
@@ -707,7 +707,6 @@ export class Canvas {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
actualRender() {
|
actualRender() {
|
||||||
if (this.offscreenCanvas.width !== this.canvas.clientWidth ||
|
if (this.offscreenCanvas.width !== this.canvas.clientWidth ||
|
||||||
this.offscreenCanvas.height !== this.canvas.clientHeight) {
|
this.offscreenCanvas.height !== this.canvas.clientHeight) {
|
||||||
@@ -727,7 +726,7 @@ export class Canvas {
|
|||||||
ctx.translate(-this.viewport.x, -this.viewport.y);
|
ctx.translate(-this.viewport.x, -this.viewport.y);
|
||||||
|
|
||||||
this.drawGrid(ctx);
|
this.drawGrid(ctx);
|
||||||
this.drawCanvasOutline(ctx);
|
// Usunięto this.drawCanvasOutline(ctx) z tego miejsca.
|
||||||
|
|
||||||
const sortedLayers = [...this.layers].sort((a, b) => a.zIndex - b.zIndex);
|
const sortedLayers = [...this.layers].sort((a, b) => a.zIndex - b.zIndex);
|
||||||
sortedLayers.forEach(layer => {
|
sortedLayers.forEach(layer => {
|
||||||
@@ -756,6 +755,10 @@ export class Canvas {
|
|||||||
}
|
}
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Dodano this.drawCanvasOutline(ctx) tutaj, aby rysowała się na wierzchu warstw.
|
||||||
|
this.drawCanvasOutline(ctx);
|
||||||
|
|
||||||
if (this.interaction.mode === 'resizingCanvas' && this.canvasResizeRect) {
|
if (this.interaction.mode === 'resizingCanvas' && this.canvasResizeRect) {
|
||||||
const rect = this.canvasResizeRect;
|
const rect = this.canvasResizeRect;
|
||||||
ctx.save();
|
ctx.save();
|
||||||
@@ -1290,6 +1293,7 @@ export class Canvas {
|
|||||||
newImage.src = tempCanvas.toDataURL();
|
newImage.src = tempCanvas.toDataURL();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mirrorVertical() {
|
mirrorVertical() {
|
||||||
if (this.selectedLayers.length === 0) return;
|
if (this.selectedLayers.length === 0) return;
|
||||||
|
|
||||||
@@ -1311,6 +1315,7 @@ export class Canvas {
|
|||||||
newImage.src = tempCanvas.toDataURL();
|
newImage.src = tempCanvas.toDataURL();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getLayerImageData(layer) {
|
async getLayerImageData(layer) {
|
||||||
try {
|
try {
|
||||||
const tempCanvas = document.createElement('canvas');
|
const tempCanvas = document.createElement('canvas');
|
||||||
|
|||||||
Reference in New Issue
Block a user