File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 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');
1313var Axes = require ( '../../plots/cartesian/axes' ) ;
1414var Fx = require ( '../../components/fx' ) ;
1515
16- var createPlot2D = require ( 'gl-plot2d' ) ;
16+ var createPlot2D = require ( '../../../../ gl-plot2d' ) ;
1717var createSpikes = require ( 'gl-spikes2d' ) ;
1818var createSelectBox = require ( 'gl-select-box' ) ;
1919var getContext = require ( 'webgl-context' ) ;
@@ -182,20 +182,24 @@ proto.toImage = function(format) {
182182 if ( ! format ) format = 'png' ;
183183
184184 this . stopped = true ;
185+
185186 if ( this . staticPlot ) this . container . appendChild ( STATIC_CANVAS ) ;
186187
187188 // update canvas size
188189 this . updateSize ( this . canvas ) ;
189190
190- // force redraw
191- this . glplot . setDirty ( ) ;
192- this . glplot . draw ( ) ;
193191
194192 // grab context and yank out pixels
195193 var gl = this . glplot . gl ,
196194 w = gl . drawingBufferWidth ,
197195 h = gl . drawingBufferHeight ;
198196
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+
199203 gl . bindFramebuffer ( gl . FRAMEBUFFER , null ) ;
200204
201205 var pixels = new Uint8Array ( w * h * 4 ) ;
You can’t perform that action at this time.
0 commit comments