Skip to content

Commit 2217f7c

Browse files
committed
5291: add transform recalc to prep funcs for various plots
1 parent cfd8e36 commit 2217f7c

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

src/lib/svg_text_utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ function alignHTMLWith(_base, container, options) {
748748
var x0 = getLeft() - cRect.left;
749749
var y0 = getTop() - cRect.top;
750750
var gd = options.gd || {};
751+
gd._fullLayout._recalculateTransformInverseIfNecessary(gd);
751752
var transformedCoords = Lib.apply3DTransform(gd._fullLayout._inverseTransform)(x0, y0);
752753
x0 = transformedCoords[0];
753754
y0 = transformedCoords[1];

src/plots/cartesian/dragbox.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
335335
x0 = startX - dragBBox.left;
336336
y0 = startY - dragBBox.top;
337337

338+
gd._fullLayout._recalculateTransformInverseIfNecessary(gd);
338339
var transformedCoords = Lib.apply3DTransform(gd._fullLayout._inverseTransform)(x0, y0);
339340
x0 = transformedCoords[0];
340341
y0 = transformedCoords[1];

src/plots/cartesian/select.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function prepSelect(e, startX, startY, dragOptions, mode) {
6868
var x0 = startX - dragBBox.left;
6969
var y0 = startY - dragBBox.top;
7070

71+
fullLayout._recalculateTransformInverseIfNecessary(gd);
7172
var transformedCoords = Lib.apply3DTransform(fullLayout._inverseTransform)(x0, y0);
7273
x0 = transformedCoords[0];
7374
y0 = transformedCoords[1];

src/plots/polar/polar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ proto.updateMainDrag = function(fullLayout) {
944944

945945
var bbox = mainDrag.getBoundingClientRect();
946946
var inverse = gd._fullLayout._inverseTransform;
947+
gd._fullLayout._recalculateTransformInverseIfNecessary(gd);
947948
var transformedCoords = Lib.apply3DTransform(inverse)(startX - bbox.left, startY - bbox.top);
948949
x0 = transformedCoords[0];
949950
y0 = transformedCoords[1];

src/plots/ternary/ternary.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ proto.initInteractions = function() {
582582
var inverse = gd._fullLayout._inverseTransform;
583583
x0 = startX - dragBBox.left;
584584
y0 = startY - dragBBox.top;
585+
gd._fullLayout._recalculateTransformInverseIfNecessary(gd);
585586
var transformedCoords = Lib.apply3DTransform(inverse)(x0, y0);
586587
x0 = transformedCoords[0];
587588
y0 = transformedCoords[1];

0 commit comments

Comments
 (0)