File tree 1 file changed +1
-4
lines changed
lib/matplotlib/backends/web_backend/js
1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -157,9 +157,6 @@ mpl.figure.prototype._init_canvas = function () {
157
157
1 ;
158
158
159
159
this . ratio = ( window . devicePixelRatio || 1 ) / backingStore ;
160
- if ( this . ratio !== 1 ) {
161
- fig . send_message ( 'set_dpi_ratio' , { dpi_ratio : this . ratio } ) ;
162
- }
163
160
164
161
var rubberband_canvas = ( this . rubberband_canvas = document . createElement (
165
162
'canvas'
@@ -227,7 +224,7 @@ mpl.figure.prototype._init_canvas = function () {
227
224
// And update the size in Python. We ignore the initial 0/0 size
228
225
// that occurs as the element is placed into the DOM, which should
229
226
// otherwise not happen due to the minimum size styling.
230
- if ( width != 0 && height != 0 ) {
227
+ if ( fig . ws . readyState == 1 && width != 0 && height != 0 ) {
231
228
fig . request_resize ( width , height ) ;
232
229
}
233
230
}
You can’t perform that action at this time.
0 commit comments