mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 00:47:53 +00:00
Preview Copy still WIP UX
This commit is contained in:
1 parent
8fea9c1a5e
commit
f6039c9967
2 files changed
+10
-7
No files matched your search
@@ -3,7 +3,7 @@ import Konva from "konva";
|
||||
import { uiAccess, uiEvents } from "~/signals";
|
||||
import { ShapeNode } from "./Nodes";
|
||||
import { PaintNode } from "./Nodes/PaintNode";
|
||||
|
||||
import { PreviewCopyNode } from "./Nodes/PreviewCopy";
|
||||
import { UndoStackManager } from "./UndoRedo";
|
||||
import { CommandManager, MatteBox, SceneManager } from "./EngineUtitlities";
|
||||
import {
|
||||
@@ -129,6 +129,9 @@ export class Engine {
|
||||
onDraw: async (canvas, lineBounds) => {
|
||||
await this.addPaintNode(canvas, lineBounds);
|
||||
},
|
||||
onPreviewCopy: async (image) => {
|
||||
await this.addPreviewCopy(image);
|
||||
},
|
||||
});
|
||||
|
||||
// Selector Square to select Nodes
|
||||
@@ -655,14 +658,14 @@ export class Engine {
|
||||
public addPreviewCopy(image: Image.Konva) {
|
||||
// Start of Selection
|
||||
const copyNode = new PreviewCopyNode({
|
||||
image: previewCopy,
|
||||
mediaLayerRef: this.mediaLayerRef,
|
||||
selectionManagerRef: this.selectionManagerRef,
|
||||
image: image,
|
||||
mediaLayerRef: this.mediaLayer,
|
||||
selectionManagerRef: this.selectionManager,
|
||||
loaded: async () => {
|
||||
this.drawingsLayer.draw();
|
||||
this.realTimeDrawEngine.render();
|
||||
},
|
||||
});
|
||||
this.commandManager.createNode(imageNode);
|
||||
this.commandManager.createNode(copyNode);
|
||||
}
|
||||
public addImage(imageFile: File) {
|
||||
const imageNode = new ImageNode({
|
||||
|
||||
@@ -170,7 +170,7 @@ export class RealTimeDrawEngine {
|
||||
this.captureCanvas.setZIndex(0);
|
||||
this.previewCanvas.setZIndex(1);
|
||||
// Add mouse events for preview canvas copying
|
||||
this.previewCopyListener();
|
||||
//this.previewCopyListener();
|
||||
|
||||
//this.startServer();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user