plainheart commented on a change in pull request #14393:
URL: https://github.com/apache/echarts/pull/14393#discussion_r635389779
##########
File path: src/component/tooltip/TooltipHTMLContent.ts
##########
@@ -60,17 +60,21 @@ function mirrorPos(pos: string): string {
}
function assembleArrow(
- backgroundColor: ColorString,
+ tooltipModel: Model<TooltipOption>,
borderColor: ZRColor,
arrowPosition: TooltipOption['position']
) {
if (!isString(arrowPosition) || arrowPosition === 'inside') {
return '';
}
+ const backgroundColor = tooltipModel.get('backgroundColor');
+ const borderWidth = tooltipModel.get('borderWidth');
+
borderColor = convertToColorString(borderColor);
const arrowPos = mirrorPos(arrowPosition);
- let positionStyle = `${arrowPos}:-6px;`;
+ const arrowSize = borderWidth >= 5 ? borderWidth : 5;
+ let positionStyle = `${arrowPos}:-${Math.sqrt(2 * arrowSize * arrowSize) /
2 + borderWidth}px;`;
Review comment:
Still here. I think it would be better to retain 1 decimal place.
Or no decimal place? This is comparison between `-5.5px` and `-5px`
**-5.5px**
<img
src="https://user-images.githubusercontent.com/26999792/118922847-467b6d80-b96d-11eb-97b4-e0b6ef518e92.png"
width="400">
**-5px**
<img
src="https://user-images.githubusercontent.com/26999792/118922827-3bc0d880-b96d-11eb-8cb2-640f6ae2bc14.png"
width="400">
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]