Ovilia commented on code in PR #19056:
URL: https://github.com/apache/echarts/pull/19056#discussion_r1309744690


##########
src/chart/helper/createClipPathFromCoordSys.ts:
##########
@@ -43,7 +44,14 @@ function createGridClipPath(
     let width = rect.width;
     let height = rect.height;
 
-    const lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;
+    const zr = cartesian.model.ecModel.scheduler.ecInstance.getZr();
+    const dpr = zr.painter instanceof CanvasPainter

Review Comment:
   A better way to get dpr is from 
https://github.com/apache/echarts/blob/master/src/core/echarts.ts#L703 . You 
may add a new parameter to this function like `dpr`.



##########
src/chart/helper/createClipPathFromCoordSys.ts:
##########
@@ -43,7 +44,14 @@ function createGridClipPath(
     let width = rect.width;
     let height = rect.height;
 
-    const lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;
+    const zr = cartesian.model.ecModel.scheduler.ecInstance.getZr();
+    const dpr = zr.painter instanceof CanvasPainter
+        ? zr.painter.dpr
+        : window.devicePixelRatio; /* global window */
+
+    const _lineWidth = seriesModel.get(['lineStyle', 'width']) || 2;
+    const lineWidth = _lineWidth * (dpr || 1);

Review Comment:
   Better with `const lineWidth = (seriesModel.get(['lineStyle', 'width']) || 
2) * (dpr || 1);`



-- 
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: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to