Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9372073

Browse filesBrowse files
authored
Merge pull request #19131 from QuLogic/fix-webagg
FIX: WebAgg initialization
2 parents 474b6b0 + 725e908 commit 9372073
Copy full SHA for 9372073

File tree

Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Filter options
  • lib/matplotlib/backends/web_backend/js
Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed

‎lib/matplotlib/backends/web_backend/js/mpl.js

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/web_backend/js/mpl.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ mpl.figure.prototype._init_canvas = function () {
157157
1;
158158

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

164161
var rubberband_canvas = (this.rubberband_canvas = document.createElement(
165162
'canvas'
@@ -227,7 +224,7 @@ mpl.figure.prototype._init_canvas = function () {
227224
// And update the size in Python. We ignore the initial 0/0 size
228225
// that occurs as the element is placed into the DOM, which should
229226
// 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) {
231228
fig.request_resize(width, height);
232229
}
233230
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.