Skip to content

Commit 34a1562

Browse files
committed
Switch from getBoundingClientRect to offsetLeft and offsetTop.
1 parent 7fe4363 commit 34a1562

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/plots/cartesian/graph_interact.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -855,11 +855,10 @@ function createSpikelines(hoverData, opts) {
855855
yLength = c0.ya._length,
856856
xEdge = c0.ya._boundingBox.left + (ySide === 'left' ? c0.ya._boundingBox.width : 0),
857857
yEdge = c0.xa._boundingBox.top + (xSide === 'top' ? c0.xa._boundingBox.height : 0),
858-
outerBBox = outerContainer.node().getBoundingClientRect(),
859858
xFreeBase = xOffset + (ySide === 'right' ? xLength : 0),
860859
yFreeBase = yOffset + (xSide === 'top' ? yLength : 0),
861-
xAnchoredBase = xEdge - outerBBox.left,
862-
yAnchoredBase = yEdge - outerBBox.top,
860+
xAnchoredBase = xEdge - outerContainer.node().offsetLeft,
861+
yAnchoredBase = yEdge - outerContainer.node().offsetTop,
863862
xBase = c0.ya.anchor === 'free' ? xFreeBase : xAnchoredBase,
864863
yBase = c0.xa.anchor === 'free' ? yFreeBase : yAnchoredBase,
865864
contrastColor = Color.combine(opts.fullLayout.plot_bgcolor, opts.fullLayout.paper_bgcolor),

0 commit comments

Comments
 (0)