@@ -13,7 +13,7 @@ var createLine = require('regl-line2d');
13
13
var createError = require ( 'regl-error2d' ) ;
14
14
var cluster = require ( 'point-cluster' ) ;
15
15
var arrayRange = require ( 'array-range' ) ;
16
- var Text = require ( 'gl-text' ) ;
16
+ var Text = require ( '../../../../ gl-text/index ' ) ;
17
17
18
18
var Registry = require ( '../../registry' ) ;
19
19
var Lib = require ( '../../lib' ) ;
@@ -215,7 +215,6 @@ function sceneUpdate(gd, subplot) {
215
215
for ( i = 0 ; i < scene . count ; i ++ ) {
216
216
opts [ i ] = opt ;
217
217
}
218
-
219
218
if ( scene . fill2d ) scene . fill2d . update ( opts ) ;
220
219
if ( scene . scatter2d ) scene . scatter2d . update ( opts ) ;
221
220
if ( scene . line2d ) scene . line2d . update ( opts ) ;
@@ -829,7 +828,8 @@ function selectPoints(searchInfo, polygon) {
829
828
if ( ! scene ) return selection ;
830
829
831
830
var hasText = subTypes . hasText ( trace ) ;
832
- var hasOnlyLines = ! subTypes . hasMarkers ( trace ) && ! hasText ;
831
+ var hasMarkers = subTypes . hasMarkers ( trace ) ;
832
+ var hasOnlyLines = ! hasMarkers && ! hasText ;
833
833
if ( trace . visible !== true || hasOnlyLines ) return selection ;
834
834
835
835
// degenerate polygon does not enable selection
@@ -870,24 +870,30 @@ function selectPoints(searchInfo, polygon) {
870
870
scene . unselectBatch [ i ] = [ ] ;
871
871
}
872
872
// we should turn scatter2d into unselected once we have any points selected
873
- scene . scatter2d . update ( scene . unselectedOptions ) ;
873
+ if ( hasMarkers ) {
874
+ scene . scatter2d . update ( scene . unselectedOptions ) ;
875
+ }
874
876
}
875
877
876
878
// update texts selection
877
879
if ( hasText ) {
878
- var el , textOptions ;
880
+ var el , textOptions , selOptions ;
879
881
if ( els ) {
880
882
for ( i = 0 ; i < els . length ; i ++ ) {
881
883
el = els [ i ] ;
882
- textOptions = scene . selectedOptions [ stash . index ] . textfont ;
884
+ selOptions = scene . selectedOptions [ stash . index ] ;
885
+ if ( ! selOptions ) continue ;
886
+ textOptions = selOptions . textfont ;
883
887
if ( ! textOptions ) continue ;
884
888
scene . glText [ stash . index ] [ el ] . update ( textOptions [ el ] ) ;
885
889
}
886
890
}
887
891
if ( unels ) {
888
892
for ( i = 0 ; i < unels . length ; i ++ ) {
889
893
el = unels [ i ] ;
890
- textOptions = scene . unselectedOptions [ stash . index ] . textfont || scene . textOptions [ stash . index ] [ el ] ;
894
+ selOptions = scene . unselectedOptions [ stash . index ] ;
895
+ if ( ! selOptions ) continue ;
896
+ textOptions = selOptions . textfont || scene . textOptions [ stash . index ] [ el ] ;
891
897
scene . glText [ stash . index ] [ el ] . update ( textOptions ) ;
892
898
}
893
899
}
0 commit comments