mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat(duplicate_element): make it work even if element is already selected
This commit is contained in:
parent
2eff4779a4
commit
a318a04641
1 changed files with 19 additions and 19 deletions
|
@ -671,6 +671,9 @@ class App extends React.Component<{}, AppState> {
|
||||||
if (!e.shiftKey) {
|
if (!e.shiftKey) {
|
||||||
clearSelection(elements);
|
clearSelection(elements);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// No matter what, we select it
|
||||||
|
hitElement.isSelected = true;
|
||||||
// We duplicate the selected element if alt is pressed on Mouse down
|
// We duplicate the selected element if alt is pressed on Mouse down
|
||||||
if (e.altKey) {
|
if (e.altKey) {
|
||||||
const element = newElement(
|
const element = newElement(
|
||||||
|
@ -689,9 +692,6 @@ class App extends React.Component<{}, AppState> {
|
||||||
|
|
||||||
elements.push(element);
|
elements.push(element);
|
||||||
}
|
}
|
||||||
// No matter what, we select it
|
|
||||||
hitElement.isSelected = true;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// If we don't click on anything, let's remove all the selected elements
|
// If we don't click on anything, let's remove all the selected elements
|
||||||
clearSelection(elements);
|
clearSelection(elements);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue