File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ proto.prepareOptions = function() {
136
136
return opts ;
137
137
} ;
138
138
139
+ var firstInit = true ;
140
+
139
141
proto . tryCreatePlot = function ( ) {
140
142
var scene = this ;
141
143
@@ -146,7 +148,7 @@ proto.tryCreatePlot = function() {
146
148
try {
147
149
scene . glplot = createPlot ( opts ) ;
148
150
} catch ( e ) {
149
- if ( scene . staticMode ) {
151
+ if ( scene . staticMode || ! firstInit ) {
150
152
success = false ;
151
153
} else { // try second time
152
154
try {
@@ -158,15 +160,22 @@ proto.tryCreatePlot = function() {
158
160
'The device may not be supported by is-mobile module!' ,
159
161
'Inverting preserveDrawingBuffer option in second attempt to create webgl scene.'
160
162
] . join ( ' ' ) ) ;
163
+
164
+ // invert is-mobile
161
165
isMobile = opts . glOptions . preserveDrawingBuffer = ! opts . glOptions . preserveDrawingBuffer ;
162
166
163
167
scene . glplot = createPlot ( opts ) ;
164
168
} catch ( e ) {
169
+ // revert changes to is-mobile
170
+ isMobile = opts . glOptions . preserveDrawingBuffer = ! opts . glOptions . preserveDrawingBuffer ;
171
+
165
172
success = false ;
166
173
}
167
174
}
168
175
}
169
176
177
+ firstInit = false ;
178
+
170
179
return success ;
171
180
} ;
172
181
You can’t perform that action at this time.
0 commit comments