[Pkg-javascript-commits] [d3-tip.js] 68/277: greatly simplify bounding box calculations

bhuvan krishna bhuvan-guest at moszumanska.debian.org
Thu Dec 8 06:57:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

bhuvan-guest pushed a commit to branch master
in repository d3-tip.js.

commit 00a955c82bc90ae5782cbc3ce39e51a5f6161eb8
Author: Justin Palmer <justin at github.com>
Date:   Sun Apr 7 14:46:01 2013 -0700

    greatly simplify bounding box calculations
---
 src/d3.tip.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/d3.tip.js b/src/d3.tip.js
index baeb7fd..771b25c 100644
--- a/src/d3.tip.js
+++ b/src/d3.tip.js
@@ -161,12 +161,12 @@ d3.svg.tip = function() {
   function get_screen_bbox() {
     var target = d3.event.target,
         bbox   = {}, x, y, width, height,
-        matrix = target.getScreenCTM()
-
-    width  = target.width  ? target.width.animVal.value  : target.r.animVal.value * 2
-    height = target.height ? target.height.animVal.value : target.r.animVal.value * 2
-    x      = target.x ? target.x.animVal.value : target.cx.animVal.value - (width / 2)
-    y      = target.y ? target.y.animVal.value : target.cy.animVal.value - (height / 2)
+        matrix = target.getScreenCTM(),
+        tbbox  = target.getBBox(),
+        width = tbbox.width,
+        height = tbbox.height,
+        x = tbbox.x,
+        y = tbbox.y
 
     point.x = x + document.body.scrollLeft
     point.y = y + document.body.scrollTop

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/d3-tip.js.git



More information about the Pkg-javascript-commits mailing list