ISSUE 3: add paste functionality
This commit is contained in:
@@ -523,6 +523,19 @@ export const DockBuilder = () => {
|
||||
|
||||
const PasteSelection = () => {
|
||||
// TODO: Paste selection
|
||||
if (clipboard) {
|
||||
clipboard.clone(function (clonedObj) {
|
||||
// Offset the pasted object so it's visible
|
||||
clonedObj.set({
|
||||
left: (clonedObj.left || 0) + 20,
|
||||
top: (clonedObj.top || 0) + 20,
|
||||
evented: true,
|
||||
});
|
||||
editorMemo.add(clonedObj);
|
||||
editorMemo.setActiveObject(clonedObj);
|
||||
editorMemo.renderAll();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const onDeleteSelection = () => {
|
||||
|
||||
Reference in New Issue
Block a user