plainheart commented on code in PR #21489:
URL: https://github.com/apache/echarts/pull/21489#discussion_r2744547319


##########
src/core/echarts.ts:
##########
@@ -1364,7 +1365,14 @@ class ECharts extends Eventful<ECEventDefinition> {
             return;
         }
 
-        this._zr.resize(opts);
+        // Default to use window.devicePixelRatio to handle browser zoom 
changes.
+        const zrResizeOpts = opts ? extend({}, opts) : {};
+        if (zrResizeOpts.devicePixelRatio == null && env.hasGlobalWindow) {
+            /* eslint-disable-next-line */
+            zrResizeOpts.devicePixelRatio = window.devicePixelRatio;
+        }
+
+        this._zr.resize(zrResizeOpts);

Review Comment:
   Since the `devicePixelRatio` is now fetched and used by zrender, I think we 
can move this logic to zrender. Here, we only need to pass the user-defined 
resize options.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to