You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/01/31 03:16:24 UTC

[GitHub] Ovilia commented on a change in pull request #9750: 修复 tooltip position 重复计算 padding

Ovilia commented on a change in pull request #9750: 修复 tooltip position 重复计算 padding
URL: https://github.com/apache/incubator-echarts/pull/9750#discussion_r252522672
 
 

 ##########
 File path: src/component/tooltip/TooltipContent.js
 ##########
 @@ -291,15 +291,13 @@ TooltipContent.prototype = {
         if (document.defaultView && document.defaultView.getComputedStyle) {
             var stl = document.defaultView.getComputedStyle(this.el);
             if (stl) {
-                width += parseInt(stl.paddingLeft, 10) + parseInt(stl.paddingRight, 10)
-                    + parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);
-                height += parseInt(stl.paddingTop, 10) + parseInt(stl.paddingBottom, 10)
-                    + parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);
+                width += parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10);
+                height += parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10);
             }
 
 Review comment:
   @oustn 's correct. Made a demo at https://jsfiddle.net/ovilia/hx04kzu1/7/ . With or without `box-sizing: border-box;`, `clientWidth` contains padding all the same.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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