duplicate element by alt dragging (#255)
This commit is contained in:
parent
4b7eb2f04a
commit
e7bf034fef
@ -675,8 +675,26 @@ class App extends React.Component<{}, AppState> {
|
||||
if (!e.shiftKey) {
|
||||
clearSelection(elements);
|
||||
}
|
||||
// No matter what, we select it
|
||||
hitElement.isSelected = true;
|
||||
}
|
||||
// No matter what, we select it
|
||||
hitElement.isSelected = true;
|
||||
// We duplicate the selected element if alt is pressed on Mouse down
|
||||
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);
|
||||
}
|
||||
} else {
|
||||
// If we don't click on anything, let's remove all the selected elements
|
||||
|
Loading…
x
Reference in New Issue
Block a user