mirror of https://gitee.com/bigwinds/arangodb
Fixes false positioning of edge #894. Tested in FF, Chrome, Safari, IE11 (all newest versions)
This commit is contained in:
parent
5ccc4cb2c0
commit
74c8752d97
|
@ -126,11 +126,23 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher
|
||||||
},
|
},
|
||||||
getCursorPositionInSVG = function (ev) {
|
getCursorPositionInSVG = function (ev) {
|
||||||
var pos = getCursorPosition(ev),
|
var pos = getCursorPosition(ev),
|
||||||
off = $('svg#graphViewerSVG').offset();
|
off = $('svg#graphViewerSVG').offset(),
|
||||||
|
svg, bBox, bCR;
|
||||||
|
svg = d3.select("svg#graphViewerSVG").node();
|
||||||
|
// Normal case. SVG has no clipped view box.
|
||||||
|
bCR = svg.getBoundingClientRect();
|
||||||
|
if ($("svg#graphViewerSVG").height() <= bCR.height ) {
|
||||||
return {
|
return {
|
||||||
x: pos.x - off.left,
|
x: pos.x - off.left,
|
||||||
y: pos.y - off.top
|
y: pos.y - off.top
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
// Firefox case. SVG has a clipped view box.
|
||||||
|
bBox = svg.getBBox();
|
||||||
|
return {
|
||||||
|
x: pos.x - (bCR.left - bBox.x),
|
||||||
|
y: pos.y - (bCR.top - bBox.y)
|
||||||
|
};
|
||||||
},
|
},
|
||||||
callbacks = {
|
callbacks = {
|
||||||
nodes: {},
|
nodes: {},
|
||||||
|
|
Loading…
Reference in New Issue