You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/05/06 03:01:33 UTC

[GitHub] [echarts] plainheart commented on a change in pull request #14393: bug(tooltip): tooltip arrow will follow borderWidth. close #14373

plainheart commented on a change in pull request #14393:
URL: https://github.com/apache/echarts/pull/14393#discussion_r627044822



##########
File path: src/component/tooltip/TooltipHTMLContent.ts
##########
@@ -81,15 +85,23 @@ function assembleArrow(
         transformStyle += `translateX(-50%) rotate(${arrowPos === 'top' ? 225 : 45}deg)`;
     }
 
-    const borderStyle = `${borderColor} solid 1px;`;
+    const borderStyle = `${borderColor} solid ${borderWidth}px;`;
     const styleCss = [
-        'position:absolute;width:10px;height:10px;',
+        `position:absolute;width:${arrowSize}px;height:${arrowSize}px;`,
         `${positionStyle};${transformStyle};`,
         `border-bottom:${borderStyle}`,
         `border-right:${borderStyle}`,
-        `background-color:${backgroundColor};`,
-        'box-shadow:8px 8px 16px -3px #000;'
+        `background-color:${backgroundColor};`
     ];
+
+    const shadowBlur = tooltipModel.get('shadowBlur');
+    const shadowColor = tooltipModel.get('shadowColor');
+    const shadowOffsetX = tooltipModel.get('shadowOffsetX');
+    const shadowOffsetY = tooltipModel.get('shadowOffsetY');
+    const boxShadow = `${shadowOffsetX}px ${shadowOffsetY}px ${shadowBlur}px ${shadowColor}`;
+
+    styleCss.push('box-shadow:' + boxShadow);

Review comment:
       If we add `box-shadow` for the arrow, it will look unexpectedly obvious. I'm not sure whether we should disable shadow of arrow.




-- 
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.

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



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