feat(duplicate_element): duplicate element by alt dragging

This commit is contained in:
Jeremy Scatigna 2020-01-08 14:37:29 +01:00
parent ae982e9298
commit ccfcbe3984

View file

@ -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 {