@@ -72,10 +72,6 @@ var HOVERTEXTPAD = constants.HOVERTEXTPAD;
7272exports . hover = function hover ( gd , evt , subplot , noHoverEvent ) {
7373 gd = Lib . getGraphDiv ( gd ) ;
7474
75- if ( gd . _inverseTransform === undefined ) {
76- gd . _inverseTransform = Lib . inverseTransformMatrix ( Lib . getFullTransformMatrix ( gd ) ) ;
77- }
78-
7975 Lib . throttle (
8076 gd . _fullLayout . _uid + constants . HOVERID ,
8177 constants . HOVERMINTIME ,
@@ -196,11 +192,7 @@ exports.loneHover = function loneHover(hoverItems, opts) {
196192 d . offset -= anchor ;
197193 } ) ;
198194
199- var gd = opts . gd ;
200- if ( gd . _inverseTransform === undefined ) {
201- gd . _inverseTransform = Lib . inverseTransformMatrix ( Lib . getFullTransformMatrix ( gd ) ) ;
202- }
203- alignHoverText ( hoverLabel , fullOpts . rotateLabels , gd . _inverseTransform ) ;
195+ alignHoverText ( hoverLabel , fullOpts . rotateLabels , opts . gd . _fullLayout . _inverseTransform ) ;
204196
205197 return multiHover ? hoverLabel : hoverLabel . node ( ) ;
206198} ;
@@ -344,7 +336,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
344336 xpx = evt . clientX - dbb . left ;
345337 ypx = evt . clientY - dbb . top ;
346338
347- var transformedCoords = Lib . apply2DTransform ( gd . _inverseTransform ) ( xpx , ypx ) ;
339+ var transformedCoords = Lib . apply2DTransform ( fullLayout . _inverseTransform ) ( xpx , ypx ) ;
348340
349341 xpx = transformedCoords [ 0 ] ;
350342 ypx = transformedCoords [ 1 ] ;
@@ -729,7 +721,7 @@ function _hover(gd, evt, subplot, noHoverEvent) {
729721
730722 if ( ! helpers . isUnifiedHover ( hovermode ) ) {
731723 hoverAvoidOverlaps ( hoverLabels , rotateLabels ? 'xa' : 'ya' , fullLayout ) ;
732- alignHoverText ( hoverLabels , rotateLabels , gd . _inverseTransform ) ;
724+ alignHoverText ( hoverLabels , rotateLabels , fullLayout . _inverseTransform ) ;
733725 }
734726
735727 // TODO: tagName hack is needed to appease geo.js's hack of using evt.target=true
0 commit comments