File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,6 +278,14 @@ const CreateShape = (props) => {
278278 yValue = values . substring ( values . indexOf ( "px" ) + 2 ) . trim ( ) ;
279279 }
280280
281+ if ( ! ( xValue . includes ( "px" ) || xValue . includes ( "%" ) ) || xValue . includes ( " " ) ) {
282+ xValue = "0%" ;
283+ }
284+
285+ if ( ! ( yValue . includes ( "px" ) || yValue . includes ( "%" ) ) || yValue === "" ) {
286+ yValue = "0%" ;
287+ }
288+
281289 return {
282290 "x" : xValue ,
283291 "y" : yValue ,
@@ -308,7 +316,7 @@ const CreateShape = (props) => {
308316 xValue = Math . round ( ( x / 280.0 ) * 100.0 ) + "%" ;
309317 yValue = Math . round ( ( y / 280.0 ) * 100.0 ) + "%" ;
310318 } else {
311-
319+
312320 // Determines whether previous x coordinate was in percentage or px and adjusts value to maintain same unit of measurement
313321 if ( shapeInformation . verticeCoordinates [ number ] . x . includes ( "%" ) ) {
314322 xValue = Math . round ( ( x / 280.0 ) * 100.0 ) + "%" ;
You can’t perform that action at this time.
0 commit comments