mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat(duplicate_element): duplicate element by alt dragging
This commit is contained in:
parent
ae982e9298
commit
ccfcbe3984
1 changed files with 17 additions and 0 deletions
|
@ -672,6 +672,23 @@ class App extends React.Component<{}, AppState> {
|
||||||
clearSelection(elements);
|
clearSelection(elements);
|
||||||
}
|
}
|
||||||
// No matter what, we select it
|
// No matter what, we select it
|
||||||
|
if (e.altKey) {
|
||||||
|
const element = newElement(
|
||||||
|
hitElement.type,
|
||||||
|
hitElement.x,
|
||||||
|
hitElement.y,
|
||||||
|
hitElement.strokeColor,
|
||||||
|
hitElement.backgroundColor,
|
||||||
|
hitElement.fillStyle,
|
||||||
|
hitElement.strokeWidth,
|
||||||
|
hitElement.roughness,
|
||||||
|
hitElement.opacity,
|
||||||
|
hitElement.width,
|
||||||
|
hitElement.height
|
||||||
|
);
|
||||||
|
|
||||||
|
elements.push(element);
|
||||||
|
}
|
||||||
hitElement.isSelected = true;
|
hitElement.isSelected = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue