@@ -14,7 +14,6 @@ var dragHelpers = require('../../dragelement/helpers');
14
14
var drawMode = dragHelpers . drawMode ;
15
15
16
16
var Registry = require ( '../../../registry' ) ;
17
- var Lib = require ( '../../../lib' ) ;
18
17
var setCursor = require ( '../../../lib/setcursor' ) ;
19
18
20
19
var MINSELECT = require ( '../../../plots/cartesian/constants' ) . MINSELECT ;
@@ -42,10 +41,17 @@ module.exports = function displayOutlines(polygons, outlines, dragOptions, nCall
42
41
// recursive call
43
42
displayOutlines ( polygons , outlines , dragOptions , nCalls ++ ) ;
44
43
44
+ if ( pointsShapeEllipse ( polygons [ 0 ] ) ) {
45
+ update ( { redrawing : true } ) ;
46
+ }
47
+ }
48
+
49
+ function update ( opts ) {
45
50
dragOptions . isActiveShape = false ; // i.e. to disable controllers
51
+
46
52
var shapes = newShapes ( outlines , dragOptions ) ;
47
53
if ( shapes ) {
48
- Registry . call ( '_guiRelayout' , gd , {
54
+ Registry . call ( opts && opts . redrawing ? 'relayout' : '_guiRelayout' , gd , {
49
55
shapes : shapes // update active shape
50
56
} ) ;
51
57
}
@@ -75,9 +81,9 @@ module.exports = function displayOutlines(polygons, outlines, dragOptions, nCall
75
81
var indexJ ; // vertex or cell-controller index
76
82
var copyPolygons ;
77
83
78
- copyPolygons = recordPositions ( [ ] , polygons ) ;
79
-
80
84
if ( isActiveShape ) {
85
+ if ( ! nCalls ) copyPolygons = recordPositions ( [ ] , polygons ) ;
86
+
81
87
var g = zoomLayer . append ( 'g' ) . attr ( 'class' , 'outline-controllers' ) ;
82
88
addVertexControllers ( g ) ;
83
89
addShapeControllers ( ) ;
@@ -133,8 +139,8 @@ module.exports = function displayOutlines(polygons, outlines, dragOptions, nCall
133
139
redraw ( ) ;
134
140
}
135
141
136
- function endDragVertexController ( evt ) {
137
- Lib . noop ( evt ) ;
142
+ function endDragVertexController ( ) {
143
+ update ( ) ;
138
144
}
139
145
140
146
function removeVertex ( ) {
@@ -307,8 +313,8 @@ module.exports = function displayOutlines(polygons, outlines, dragOptions, nCall
307
313
shapeDragOptions [ indexI ] . moveFn = moveShapeController ;
308
314
}
309
315
310
- function endDragShapeController ( evt ) {
311
- Lib . noop ( evt ) ;
316
+ function endDragShapeController ( ) {
317
+ update ( ) ;
312
318
}
313
319
314
320
function addShapeControllers ( ) {
0 commit comments