Skip to content

Commit fa8d0bb

Browse files
committed
feat: fixed issue where cannot create new vertices when there are no vertices
1 parent f2d6c29 commit fa8d0bb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

components/core/CreateShape.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const CreateShape = (props) => {
5959
const name = event.target.name || event.type;
6060
const value = event.target.type === "checkbox" ? event.target.checked : event.target.value;
6161

62-
// console.log(event, data);
62+
console.log(event, data);
6363

6464
// If Clip-Path formula value is changed, it makes sure that the parentheses stay there and also alters the verticeCoordinates value
6565
if (name === "name") {
@@ -142,8 +142,8 @@ const CreateShape = (props) => {
142142
return;
143143
}
144144

145-
// If background of preview is clicked and the clipPathType is a polygon, add a verticeCoordinate value at its location and adjust formula
146-
if (name === "click" && event.target.id === "shapeShadow" && shapeInformation.clipPathType === "polygon") {
145+
// If preview is clicked and the clipPathType is a polygon, add a verticeCoordinate value at its location and adjust formula
146+
if ((event.target.id === "shapeShadow" || event.target.id === "clippedShape") && name === "click" && shapeInformation.clipPathType === "polygon") {
147147

148148
const newVerticeCoordinates = addNewVerticeCoordinates(event.nativeEvent.offsetX, event.nativeEvent.offsetY, shapeInformation.verticeCoordinates.length);
149149
const newFormula = generateNewFormula(newVerticeCoordinates);

0 commit comments

Comments
 (0)