Skip to content

Commit e83b947

Browse files
MFedMFed
MFed
authored and
MFed
committed
Fixing bug where annotation would be marked as offscreen if the head was offscreen even if the tail is in coordinate space and on screen.
1 parent 143328d commit e83b947

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/annotations/index.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,16 @@ annotations.draw = function(gd, index, opt, value) {
446446
// anyway to get its bounding box)
447447
if(!ax.autorange && ((options[axLetter] - ax.range[0]) *
448448
(options[axLetter] - ax.range[1]) > 0)) {
449-
annotationIsOffscreen = true;
450-
return;
449+
if(options['a' + axLetter + 'ref'] === axRef) {
450+
if((options['a' + axLetter] - ax.range[0]) *
451+
(options['a' + axLetter] - ax.range[1]) > 0) {
452+
annotationIsOffscreen = true;
453+
}
454+
} else {
455+
annotationIsOffscreen = true;
456+
}
457+
458+
if(annotationIsOffscreen) return;
451459
}
452460
annPosPx[axLetter] = ax._offset + ax.l2p(options[axLetter]);
453461
alignPosition = 0.5;

0 commit comments

Comments
 (0)