@@ -85,6 +85,8 @@ function drawOne(gd, index) {
8585function drawRaw ( gd , options , index , subplotId , xa , ya ) {
8686 var fullLayout = gd . _fullLayout ;
8787 var gs = gd . _fullLayout . _size ;
88+ var edits = gd . _context . edits ;
89+
8890 var className ;
8991 var annbase ;
9092
@@ -128,8 +130,11 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
128130 var annTextGroup = annGroup . append ( 'g' )
129131 . classed ( 'annotation-text-g' , true ) ;
130132
133+ var editTextPosition = edits [ options . showarrow ? 'annotationTail' : 'annotationPosition' ] ;
134+ var textEvents = options . captureevents || edits . annotationText || editTextPosition ;
135+
131136 var annTextGroupInner = annTextGroup . append ( 'g' )
132- . style ( 'pointer-events' , options . captureevents ? 'all' : null )
137+ . style ( 'pointer-events' , textEvents ? 'all' : null )
133138 . call ( setCursor , 'default' )
134139 . on ( 'click' , function ( ) {
135140 gd . _dragging = false ;
@@ -519,7 +524,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
519524
520525 // the arrow dragger is a small square right at the head, then a line to the tail,
521526 // 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 ) {
523528 var arrowDragHeadX = headX ;
524529 var arrowDragHeadY = headY ;
525530 if ( options . standoff ) {
@@ -601,7 +606,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
601606 if ( options . showarrow ) drawArrow ( 0 , 0 ) ;
602607
603608 // user dragging the annotation (text, not arrow)
604- if ( gd . _context . editable ) {
609+ if ( editTextPosition ) {
605610 var update ,
606611 baseTextTransform ;
607612
@@ -679,7 +684,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
679684 }
680685 }
681686
682- if ( gd . _context . editable ) {
687+ if ( edits . annotationText ) {
683688 annText . call ( svgTextUtils . makeEditable , { delegate : annTextGroupInner , gd : gd } )
684689 . call ( textLayout )
685690 . on ( 'edit' , function ( _text ) {
0 commit comments