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



##########
File path: src/component/tooltip/TooltipView.ts
##########
@@ -1084,7 +1084,8 @@ function confineTooltipPosition(
 function calcTooltipPosition(
     position: TooltipOption['position'],
     rect: ZRRectLike,
-    contentSize: number[]
+    contentSize: number[],
+    borderWidth: number
 ): [number, number] {

Review comment:
       By the [review 
comment](https://github.com/apache/echarts/pull/14393#discussion_r635372765) in 
https://github.com/apache/echarts/blob/2b39cb408712ce3710801dd5219d0a14aad5b3ce/src/component/tooltip/TooltipView.ts#L1104
   the tooltip may be a bit far away from the element.
   
   Let us take a look at the following lines
   
https://github.com/apache/echarts/blob/2b39cb408712ce3710801dd5219d0a14aad5b3ce/src/component/tooltip/TooltipView.ts#L1092-L1093
   The usage of `offset` and `gap` looks similar and their value is a fixed 
number. May we merge them into one value calculated with the border width?
   
   For example,
   ```js
   // Sure, if `borderWidth` is very small or 0, we could also set a limit of 
minimized value.
   Math.sqrt(2 * borderWidth * borderWidth)
   ``` 




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

Reply via email to