Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/components/fx/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,9 @@ function _hover(gd, evt, subplot, noHoverEvent) {
if(hasUserCalledHover) {
if('xpx' in evt) xpx = evt.xpx;
else xpx = xaArray[0]._length / 2;
evt.pointerX = xpx + xaArray[0]._offset;

if('ypx' in evt) ypx = evt.ypx;
else ypx = yaArray[0]._length / 2;
evt.pointerY = ypx + yaArray[0]._offset;
}
else {
// fire the beforehover event and quit if it returns false
Expand All @@ -300,13 +298,14 @@ function _hover(gd, evt, subplot, noHoverEvent) {

// in case hover was called from mouseout into hovertext,
// it's possible you're not actually over the plot anymore
if(xpx < 0 || xpx > dbb.width || ypx < 0 || ypx > dbb.height) {
if(xpx < 0 || xpx > xaArray[0]._length || ypx < 0 || ypx > yaArray[0]._length) {
return dragElement.unhoverRaw(gd, evt);
}
evt.pointerX = evt.offsetX;
evt.pointerY = evt.offsetY;
}

evt.pointerX = xpx + xaArray[0]._offset;
evt.pointerY = ypx + yaArray[0]._offset;

if('xval' in evt) xvalArray = helpers.flat(subplots, evt.xval);
else xvalArray = helpers.p2c(xaArray, xpx);

Expand Down
6 changes: 6 additions & 0 deletions tasks/test_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ function assertSrcContents() {
// Forbidden in IE in any context
var IE_BLACK_LIST = ['classList'];

// not implemented in FF, or inconsistent with others
var FF_BLACK_LIST = ['offsetX', 'offsetY'];

// require'd built-in modules
var BUILTINS = ['events'];

Expand Down Expand Up @@ -103,6 +106,9 @@ function assertSrcContents() {
else if(IE_SVG_BLACK_LIST.indexOf(lastPart) !== -1) {
logs.push(file + ' : contains .' + lastPart + ' (IE failure in SVG)');
}
else if(FF_BLACK_LIST.indexOf(lastPart) !== -1) {
logs.push(file + ' : contains .' + lastPart + ' (FF failure)');
}
}
else if(node.type === 'Identifier' && node.source() === 'getComputedStyle') {
if(node.parent.source() !== 'window.getComputedStyle') {
Expand Down