|
@@ -675,8 +675,26 @@ 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;
|
|
|
|
|
|
+ }
|
|
|
|
+ // 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 {
|
|
} 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
|