Skip to content

Commit 84ede31

Browse files
committed
888: fix alignHTMLWith
1 parent 23b4d3c commit 84ede31

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib/svg_text_utils.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,17 @@ function alignHTMLWith(_base, container, options) {
743743

744744
return function() {
745745
thisRect = this.node().getBoundingClientRect();
746+
747+
var x0 = getLeft() - cRect.left;
748+
var y0 = getTop() - cRect.top;
749+
var gd = options.gd || {};
750+
var transformedCoords = Lib.apply3DTransform(gd._fullLayout._inverseTransform)(x0, y0);
751+
x0 = transformedCoords[0];
752+
y0 = transformedCoords[1];
753+
746754
this.style({
747-
top: (getTop() - cRect.top) + 'px',
748-
left: (getLeft() - cRect.left) + 'px',
755+
top: y0 + 'px',
756+
left: x0 + 'px',
749757
'z-index': 1000
750758
});
751759
return this;

0 commit comments

Comments
 (0)