File tree 2 files changed +49
-1
lines changed
2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -930,9 +930,10 @@ function styleTextSelection(cd) {
930
930
var hasArrayBase = Array . isArray ( base ) ;
931
931
opts . color = new Array ( stash . count ) ;
932
932
933
+
933
934
for ( i = 0 ; i < els . length ; i ++ ) {
934
935
j = els [ i ] ;
935
- opts . color [ j ] = stc || hasArrayBase ? base [ j ] : base ;
936
+ opts . color [ j ] = stc || ( hasArrayBase ? base [ j ] : base ) ;
936
937
}
937
938
for ( i = 0 ; i < unels . length ; i ++ ) {
938
939
j = unels [ i ] ;
Original file line number Diff line number Diff line change @@ -792,6 +792,32 @@ describe('@noCI @gl Test gl2d lasso/select:', function() {
792
792
]
793
793
} ) ;
794
794
} )
795
+ . then ( function ( ) {
796
+ return Plotly . restyle ( gd , 'selected.textfont.color' , 'red' ) ;
797
+ } )
798
+ . then ( function ( ) { return select ( [ [ 100 , 100 ] , [ 250 , 250 ] ] ) ; } )
799
+ . then ( function ( ) {
800
+ _assertGlTextOpts ( 'after selection - with set selected.textfont.color' , {
801
+ rgba : [
802
+ [
803
+ 68 , 68 , 68 , 255 ,
804
+ 68 , 68 , 68 , 255 ,
805
+ 68 , 68 , 68 , 255 ,
806
+ ] ,
807
+ [
808
+ 68 , 68 , 68 , 255 ,
809
+ // this is the selected pt!
810
+ 255 , 0 , 0 , 255 ,
811
+ 68 , 68 , 68 , 255
812
+ ] ,
813
+ [
814
+ 68 , 68 , 68 , 255 ,
815
+ 68 , 68 , 68 , 255 ,
816
+ 68 , 68 , 68 , 255
817
+ ]
818
+ ]
819
+ } ) ;
820
+ } )
795
821
. catch ( failTest )
796
822
. then ( done ) ;
797
823
} ) ;
@@ -851,6 +877,27 @@ describe('@noCI @gl Test gl2d lasso/select:', function() {
851
877
]
852
878
} ) ;
853
879
} )
880
+ . then ( function ( ) {
881
+ return Plotly . restyle ( gd , 'selected.textfont.color' , 'red' ) ;
882
+ } )
883
+ . then ( function ( ) { return select ( [ [ 100 , 10 ] , [ 250 , 100 ] ] ) ; } )
884
+ . then ( function ( ) {
885
+ _assertGlTextOpts ( 'after selection - with set selected.textfont.color' , {
886
+ rgba : [
887
+ [
888
+ 255 , 0 , 0 , 255 ,
889
+ 0 , 0 , 255 , 255 ,
890
+ 0 , 128 , 0 , 255
891
+ ] ,
892
+ [
893
+ 0 , 0 , 0 , 255 ,
894
+ // this is the selected pt!
895
+ 255 , 0 , 0 , 255 ,
896
+ 237 , 97 , 0 , 255
897
+ ]
898
+ ]
899
+ } ) ;
900
+ } )
854
901
. catch ( failTest )
855
902
. then ( done ) ;
856
903
} ) ;
You can’t perform that action at this time.
0 commit comments