File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ var Registry = require('../../registry');
13
13
var Axes = require ( '../../plots/cartesian/axes' ) ;
14
14
var Fx = require ( '../../components/fx' ) ;
15
15
16
- var createPlot2D = require ( 'gl-plot2d' ) ;
16
+ var createPlot2D = require ( '../../../../ gl-plot2d' ) ;
17
17
var createSpikes = require ( 'gl-spikes2d' ) ;
18
18
var createSelectBox = require ( 'gl-select-box' ) ;
19
19
var getContext = require ( 'webgl-context' ) ;
@@ -182,20 +182,24 @@ proto.toImage = function(format) {
182
182
if ( ! format ) format = 'png' ;
183
183
184
184
this . stopped = true ;
185
+
185
186
if ( this . staticPlot ) this . container . appendChild ( STATIC_CANVAS ) ;
186
187
187
188
// update canvas size
188
189
this . updateSize ( this . canvas ) ;
189
190
190
- // force redraw
191
- this . glplot . setDirty ( ) ;
192
- this . glplot . draw ( ) ;
193
191
194
192
// grab context and yank out pixels
195
193
var gl = this . glplot . gl ,
196
194
w = gl . drawingBufferWidth ,
197
195
h = gl . drawingBufferHeight ;
198
196
197
+ // force redraw
198
+ gl . clearColor ( 1 , 1 , 1 , 0 ) ;
199
+ gl . clear ( gl . COLOR_BUFFER_BIT | gl . DEPTH_BUFFER_BIT ) ;
200
+ this . glplot . setDirty ( ) ;
201
+ this . glplot . draw ( ) ;
202
+
199
203
gl . bindFramebuffer ( gl . FRAMEBUFFER , null ) ;
200
204
201
205
var pixels = new Uint8Array ( w * h * 4 ) ;
You can’t perform that action at this time.
0 commit comments