Fix painting bug, Now need to fix layer preview bug so it always stays on top.

This commit is contained in:
CrossPr0duct committed 2025-03-01 15:03:45 -05:00
1 parent 0eaf98f065
commit fcd6c4cbcd
2 files changed
+6 -4

No files matched your search

+3 -3
View File
@@ -466,12 +466,12 @@ export class Engine {
uiEvents.promptEvents.onPromptStrengthChanged(async (strength) => {
this.realTimeDrawEngine.currentStrength = strength / 100.0;
this.realTimeDrawEngine.render();
// this.realTimeDrawEngine.render();
});
uiEvents.promptEvents.onPromptTextChanged(async (prompt) => {
this.realTimeDrawEngine.currentPrompt = prompt;
this.realTimeDrawEngine.render();
// this.realTimeDrawEngine.render();
});
uiEvents.onAddShapeToEngine((shapeData) => {
@@ -681,7 +681,7 @@ export class Engine {
await this.realTimeDrawEngine.render();
},
});
imageNode.kNode.zIndex(1);
this.commandManager.createNode(imageNode);
}
public addPaintNode(
@@ -138,6 +138,7 @@ export class RealTimeDrawEngine {
this.drawingsLayer = new Konva.Layer({
clearBeforeDraw: true, // Ensures transparent background
});
this.mediaLayerRef.getStage()?.add(this.drawingsLayer); // to od pass in stage
// Set background layer to red and media layer to green for visibility
@@ -270,7 +271,7 @@ export class RealTimeDrawEngine {
y: this.captureCanvas.y(),
draggable: false,
});
this.drawingsLayer.moveToTop();
this.drawingsLayer.add(currentLine); // Add to drawingsLayer
isDrawing = true;
};
@@ -407,6 +408,7 @@ export class RealTimeDrawEngine {
this.enableDragging();
if (this.cleanupFunction) {
this.cleanupFunction();
this.cleanupFunction = null;
}
}