@@ -85,6 +85,8 @@ function drawOne(gd, index) {
85
85
function drawRaw ( gd , options , index , subplotId , xa , ya ) {
86
86
var fullLayout = gd . _fullLayout ;
87
87
var gs = gd . _fullLayout . _size ;
88
+ var edits = gd . _context . edits ;
89
+
88
90
var className ;
89
91
var annbase ;
90
92
@@ -128,8 +130,11 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
128
130
var annTextGroup = annGroup . append ( 'g' )
129
131
. classed ( 'annotation-text-g' , true ) ;
130
132
133
+ var editTextPosition = edits [ options . showarrow ? 'annotationTail' : 'annotationPosition' ] ;
134
+ var textEvents = options . captureevents || edits . annotationText || editTextPosition ;
135
+
131
136
var annTextGroupInner = annTextGroup . append ( 'g' )
132
- . style ( 'pointer-events' , options . captureevents ? 'all' : null )
137
+ . style ( 'pointer-events' , textEvents ? 'all' : null )
133
138
. call ( setCursor , 'default' )
134
139
. on ( 'click' , function ( ) {
135
140
gd . _dragging = false ;
@@ -519,7 +524,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
519
524
520
525
// the arrow dragger is a small square right at the head, then a line to the tail,
521
526
// all expanded by a stroke width of 6px plus the arrow line width
522
- if ( gd . _context . editable && arrow . node ( ) . parentNode && ! subplotId ) {
527
+ if ( edits . annotationPosition && arrow . node ( ) . parentNode && ! subplotId ) {
523
528
var arrowDragHeadX = headX ;
524
529
var arrowDragHeadY = headY ;
525
530
if ( options . standoff ) {
@@ -601,7 +606,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
601
606
if ( options . showarrow ) drawArrow ( 0 , 0 ) ;
602
607
603
608
// user dragging the annotation (text, not arrow)
604
- if ( gd . _context . editable ) {
609
+ if ( editTextPosition ) {
605
610
var update ,
606
611
baseTextTransform ;
607
612
@@ -679,7 +684,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
679
684
}
680
685
}
681
686
682
- if ( gd . _context . editable ) {
687
+ if ( edits . annotationText ) {
683
688
annText . call ( svgTextUtils . makeEditable , { delegate : annTextGroupInner , gd : gd } )
684
689
. call ( textLayout )
685
690
. on ( 'edit' , function ( _text ) {
0 commit comments