Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/matplotlib/backends/web_backend/js/mpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ mpl.figure.prototype._init_canvas = function () {
1;

this.ratio = (window.devicePixelRatio || 1) / backingStore;
if (this.ratio !== 1) {
fig.send_message('set_dpi_ratio', { dpi_ratio: this.ratio });
}

var rubberband_canvas = (this.rubberband_canvas = document.createElement(
'canvas'
Expand Down Expand Up @@ -227,7 +224,7 @@ mpl.figure.prototype._init_canvas = function () {
// And update the size in Python. We ignore the initial 0/0 size
// that occurs as the element is placed into the DOM, which should
// otherwise not happen due to the minimum size styling.
if (width != 0 && height != 0) {
if (fig.ws.readyState == 1 && width != 0 && height != 0) {
fig.request_resize(width, height);
}
}
Expand Down