@@ -13,6 +13,8 @@ export class View extends draw2d.Canvas {
1313 console . log ( "height, width" , canvasHolder . offsetHeight , wrapperWidth )
1414 super ( id , wrapperWidth , canvasHolder . offsetHeight ) ;
1515 this . rCounter = 0 ;
16+ this . cCounter = 0 ;
17+ this . lCounter = 0 ;
1618 this . elements = [ ] ;
1719 this . dropCb = dropCB ;
1820 // this.setScrollArea("#"+id);
@@ -37,7 +39,6 @@ export class View extends draw2d.Canvas {
3739 {
3840 console . log ( "yolo" )
3941 var type = $ ( droppedDomNode ) . data ( "shape" ) ;
40- this . rCounter = this . rCounter + 1 ;
4142 // console.log(this.rCounter);
4243 // var figure = eval("new "+type+"();");
4344
@@ -55,13 +56,15 @@ export class View extends draw2d.Canvas {
5556 e . createPort ( "hybrid" , inputLocator ) ;
5657 e . createPort ( "hybrid" , outputLocator ) ;
5758 e . id = `R${ this . rCounter } ` ;
59+ this . rCounter = this . rCounter + 1 ;
5860 } else if ( type == "cap" ) {
5961 var e = new shapeCap ( { x :x , y :y } ) ;
6062 var inputLocator = new draw2d . layout . locator . InputPortLocator ( ) ;
6163 var outputLocator = new draw2d . layout . locator . OutputPortLocator ( ) ;
6264 e . createPort ( "hybrid" , inputLocator ) ;
6365 e . createPort ( "hybrid" , outputLocator ) ;
64- e . id = `R${ this . rCounter } ` ;
66+ e . id = `C${ this . cCounter } ` ;
67+ this . cCounter = this . cCounter + 1 ;
6568 } else if ( type == "vin" ) {
6669 var e = new shapeVin ( { x :x , y :y } ) ;
6770 var inputLocator = new draw2d . layout . locator . InputPortLocator ( ) ;
0 commit comments