@@ -41,6 +41,7 @@ export default class ElementEditor {
41
41
} ;
42
42
this . connectorSnapping = {
43
43
canSnap : false ,
44
+ snapShapeId : null ,
44
45
snapTo : null
45
46
} ;
46
47
this . lineHandleManipulate = 0 ;
@@ -295,6 +296,12 @@ export default class ElementEditor {
295
296
enteredText . remove ( ) ;
296
297
}
297
298
299
+ /**
300
+ * Get attibutes of shape and its container in an array
301
+ * where first element is name and second is value
302
+ * @param {* } shape
303
+ * @returns
304
+ */
298
305
getElementAttributes ( shape ) {
299
306
const selshape = shape . getCorropspondingShape ( ) ;
300
307
const shapeParams = selshape . attributes ;
@@ -311,6 +318,9 @@ export default class ElementEditor {
311
318
return shapeArray ;
312
319
}
313
320
321
+ /**
322
+ * Get all bounds of shape along with parsed translation
323
+ */
314
324
getAllElementBounds ( shape ) {
315
325
const shapeToResize = shape
316
326
. getCorropspondingShape ( ) ;
@@ -385,7 +395,13 @@ export default class ElementEditor {
385
395
if ( ev . target . classList . contains ( 'connector' ) ) {
386
396
const connector = ev . target ;
387
397
const connectorPos = connector . getBoundingClientRect ( ) ;
398
+ const oldSelShape = this . listOfElements [ this . elementLookup . get (
399
+ this . selectedElement . corrospondingShapeID ) ] ;
388
400
this . selectcreate ( 'connectionline' ) ;
401
+ oldSelShape . allConnections . push ( {
402
+ id : this . selectedElement . corrospondingShapeID ,
403
+ point : 0
404
+ } ) ;
389
405
const connectorline = this . selectedElement . getCorropspondingShape ( ) ;
390
406
const connectorlineContainer = connectorline . parentNode ;
391
407
@@ -626,6 +642,12 @@ export default class ElementEditor {
626
642
if ( ! this . selectedElement ) {
627
643
return ;
628
644
}
645
+
646
+ // Special case for connection lines
647
+ if ( this . editor . getCurrentCommand ( ) == 'connect' && this . connectorSnapping . snapTo ) {
648
+
649
+ }
650
+
629
651
// Save the history
630
652
const attrs = this . getElementAttributes ( this . selectedElement ) ;
631
653
0 commit comments