Skip to content

Commit 0403aa7

Browse files
committed
5291: simplify recalculate fn name
1 parent 2217f7c commit 0403aa7

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

src/components/fx/hover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
340340
xpx = evt.clientX - dbb.left;
341341
ypx = evt.clientY - dbb.top;
342342

343-
fullLayout._recalculateTransformInverseIfNecessary(gd);
343+
fullLayout._calcInverseTransform(gd);
344344
var transformedCoords = Lib.apply3DTransform(fullLayout._inverseTransform)(xpx, ypx);
345345

346346
xpx = transformedCoords[0];

src/lib/svg_text_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +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);
751+
gd._fullLayout._calcInverseTransform(gd);
752752
var transformedCoords = Lib.apply3DTransform(gd._fullLayout._inverseTransform)(x0, y0);
753753
x0 = transformedCoords[0];
754754
y0 = transformedCoords[1];

src/plot_api/plot_api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3707,7 +3707,7 @@ function purge(gd) {
37073707
}
37083708

37093709
// determines if the graph div requires a recalculation of its inverse matrix transforms by comparing old + new bounding boxes.
3710-
function recalculateTransformInverseIfNecessary(gd, newBBox) {
3710+
function calcInverseTransform(gd, newBBox) {
37113711
gd = Lib.getGraphDiv(gd);
37123712
var fullLayout = gd._fullLayout;
37133713
if (!newBBox)
@@ -3727,8 +3727,8 @@ function makePlotFramework(gd) {
37273727
var gd3 = d3.select(gd);
37283728
var fullLayout = gd._fullLayout;
37293729

3730-
fullLayout._recalculateTransformInverseIfNecessary = recalculateTransformInverseIfNecessary;
3731-
fullLayout._recalculateTransformInverseIfNecessary(gd);
3730+
fullLayout._calcInverseTransform = calcInverseTransform;
3731+
fullLayout._calcInverseTransform(gd);
37323732

37333733
// Plot container
37343734
fullLayout._container = gd3.selectAll('.plot-container').data([0]);

src/plots/cartesian/dragbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +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);
338+
gd._fullLayout._calcInverseTransform(gd);
339339
var transformedCoords = Lib.apply3DTransform(gd._fullLayout._inverseTransform)(x0, y0);
340340
x0 = transformedCoords[0];
341341
y0 = transformedCoords[1];

src/plots/cartesian/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +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);
71+
fullLayout._calcInverseTransform(gd);
7272
var transformedCoords = Lib.apply3DTransform(fullLayout._inverseTransform)(x0, y0);
7373
x0 = transformedCoords[0];
7474
y0 = transformedCoords[1];

src/plots/polar/polar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ proto.updateMainDrag = function(fullLayout) {
944944

945945
var bbox = mainDrag.getBoundingClientRect();
946946
var inverse = gd._fullLayout._inverseTransform;
947-
gd._fullLayout._recalculateTransformInverseIfNecessary(gd);
947+
gd._fullLayout._calcInverseTransform(gd);
948948
var transformedCoords = Lib.apply3DTransform(inverse)(startX - bbox.left, startY - bbox.top);
949949
x0 = transformedCoords[0];
950950
y0 = transformedCoords[1];
@@ -1294,6 +1294,7 @@ proto.updateAngularDrag = function(fullLayout) {
12941294
x0 = startX - bbox.left;
12951295
y0 = startY - bbox.top;
12961296

1297+
gd._fullLayout._calcInverseTransform(gd);
12971298
var transformedCoords = Lib.apply3DTransform(fullLayout._inverseTransform)(x0, y0);
12981299
x0 = transformedCoords[0];
12991300
y0 = transformedCoords[1];

src/plots/ternary/ternary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +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);
585+
gd._fullLayout._calcInverseTransform(gd);
586586
var transformedCoords = Lib.apply3DTransform(inverse)(x0, y0);
587587
x0 = transformedCoords[0];
588588
y0 = transformedCoords[1];

0 commit comments

Comments
 (0)