summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-18 20:46:42 +0300
committerMichael Lando <ml636r@att.com>2017-07-18 20:46:42 +0300
commit39a4e0cb1b805470ad85ed4cf4fdeb69610ae98c (patch)
tree9faa499670544cce1ec5510c242ad984871ca32d /catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js
parentb8e2faf476202b6ffe61bc3a9a37df1304881d40 (diff)
[SDC] rebase 1710
Change-Id: I07fced02f40a57700d9d35ed3ba498bca351fb13 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js')
-rw-r--r--catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js b/catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js
index 2da6f786ea..9be07f2ea1 100644
--- a/catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js
+++ b/catalog-ui/src/third-party/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js
@@ -250,13 +250,14 @@
_drawHandle: function (handle, target) {
var position = this._getHandlePosition(handle, target);
-
+ var handleSize = target.renderedWidth() / 4;
+
this._ctx.beginPath();
if (handle.imageUrl) {
var base_image = new Image();
base_image.src = handle.imageUrl;
- this._ctx.drawImage(base_image, position.x, position.y, this.HANDLE_SIZE, this.HANDLE_SIZE);
+ this._ctx.drawImage(base_image, position.x, position.y, handleSize, handleSize);
} else {
this._ctx.arc(position.x, position.y, this.HANDLE_SIZE, 0, 2 * Math.PI, false);
this._ctx.fillStyle = handle.color;
@@ -461,17 +462,17 @@
},
_getHandlePosition: function (handle, target) {
var position = target.renderedPosition();
- var width = target.renderedOuterWidth();
- var height = target.renderedOuterHeight();
+ var width = target.renderedWidth();
+ var height = target.renderedHeight();
var xpos = null;
var ypos = null;
switch (handle.positionX) {
case "left":
- xpos = position.x - width / 2 + this.HANDLE_SIZE;
+ xpos = position.x - width / 4;
break;
case "right":
- xpos = position.x + width / 2 - this.HANDLE_SIZE;
+ xpos = position.x + width / 4;
break;
case "center":
xpos = position.x;
@@ -480,18 +481,18 @@
switch (handle.positionY) {
case "top":
- ypos = position.y - height / 2 + this.HANDLE_SIZE;
+ ypos = position.y - width / 2;
break;
case "center":
ypos = position.y;
break;
case "bottom":
- ypos = position.y + height / 2 - this.HANDLE_SIZE;
+ ypos = position.y + width / 2;
break;
}
- var offsetX = handle.offsetX ? handle.offsetX : 0;
- var offsetY = handle.offsetY ? handle.offsetY : 0;
+ var offsetX = 0;
+ var offsetY = 0;
return {x: xpos + offsetX, y: ypos + offsetY};
},
_getEdgeCSSByHandle: function (handle) {