File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,27 @@ proto.toImage = function(format) {
169169 this . stopped = true ;
170170 if ( this . staticPlot ) this . container . appendChild ( STATIC_CANVAS ) ;
171171
172+
173+
174+ var glplot = this . glplot ,
175+ pixelRatio = this . pixelRatio ;
176+
177+ let fullLayout = this . fullLayout ;
178+
179+ var width = fullLayout . width ,
180+ height = fullLayout . height ,
181+ pixelWidth = Math . ceil ( pixelRatio * width ) | 0 ,
182+ pixelHeight = Math . ceil ( pixelRatio * height ) | 0 ;
183+
184+ // check for resize
185+ var canvas = this . canvas ;
186+ if ( canvas . width !== pixelWidth || canvas . height !== pixelHeight ) {
187+ canvas . width = pixelWidth ;
188+ canvas . height = pixelHeight ;
189+ }
190+
191+
192+
172193 // force redraw
173194 this . glplot . setDirty ( ) ;
174195 this . glplot . draw ( ) ;
You can’t perform that action at this time.
0 commit comments