From b56bf030615de2cc1ae48b258c7063bb5b0ac858 Mon Sep 17 00:00:00 2001 From: Nils Christian Ehmke <nie@informatik.uni-kiel.de> Date: Fri, 19 Apr 2013 12:54:35 +0200 Subject: [PATCH] #981 --- .../src/main/webapp/js/flowEditor.js | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Kieker.WebGUI/src/main/webapp/js/flowEditor.js b/Kieker.WebGUI/src/main/webapp/js/flowEditor.js index 90afa0ee..b02deced 100644 --- a/Kieker.WebGUI/src/main/webapp/js/flowEditor.js +++ b/Kieker.WebGUI/src/main/webapp/js/flowEditor.js @@ -957,7 +957,7 @@ function GraphFlow(){ if(isAnimated){ endPos.x = x; endPos.y = y; - node.setPos(endPos, "end"); + node.setPos(endPos, 'end'); node.setData('width', width, 'end'); node.setData('height', height, 'end'); }else{ @@ -1410,7 +1410,7 @@ function GraphFlow(){ var canvas = fd.canvas, scale = canvas.scaleOffsetX, centerX = -canvas.translateOffsetX / scale, - centerY = -canvas.translateOffsetX / scale; + centerY = -canvas.translateOffsetY / scale; return {'x' : centerX, 'y' : centerY}; } @@ -1866,6 +1866,8 @@ function GraphFlow(){ } */ + var pos = new $jit.Complex(0,0); + var maxPorts = Math.max(countInput, countRepo+countOutput+0.5), size = vertexLabelSize*2; @@ -1945,8 +1947,15 @@ function GraphFlow(){ closeButton.data.$family = newNode; // set node positions - newNode.pos.setc(xPosition, yPosition); - closeButton.pos.setc(xPosition + (width - vertexLabelSize) / 2 , yPosition - height / 2 + size); + pos.x = xPosition; + pos.y = yPosition; + newNode.setPos(pos, 'current'); + newNode.setPos(pos, 'end'); + + pos.x = xPosition + (width - vertexLabelSize) / 2; + pos.y = yPosition - height / 2 + size; + closeButton.setPos(pos, 'current'); + closeButton.setPos(pos, 'end'); newNode.data.$children.push(closeButton); // Loop Info: @@ -2017,11 +2026,13 @@ function GraphFlow(){ g.addNode(newPort); newPort = g.getNode(newPort.id); - newPort.pos.setc(x, y); + pos.x = x; + pos.y = y; + newPort.setPos(pos, 'current'); + newPort.setPos(pos, 'end'); newNode.data.$children.push(newPort); y += size; - //} } } } -- GitLab