Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Fix problem with getBBox SVG function on tspan and similar elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed May 29, 2012
1 parent cb6f64a commit 2d4f050
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.basic.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun May 20 16:24:07 2012 +0100
* Date: Wed May 23 18:10:39 2012 +0100
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun May 20 16:24:07 2012 +0100
* Date: Wed May 23 18:10:39 2012 +0100
*/

/* Core qTip styles */
Expand Down
6 changes: 5 additions & 1 deletion dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun May 20 16:24:07 2012 +0100
* Date: Wed May 23 18:10:39 2012 +0100
*/

/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
Expand Down Expand Up @@ -2676,6 +2676,10 @@ PLUGINS.svg = function(svg, corner)
},
box, mtx, root, point, tPoint;

// Ascend the parentNode chain until we find an element with getBBox()
while(!elem.getBBox) { elem = elem.parentNode; }

// Check for a valid bounding box method
if (elem.getBBox && elem.parentNode) {
box = elem.getBBox();
mtx = elem.getScreenCTM();
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/svg/svg.js
Expand Up @@ -8,6 +8,10 @@ PLUGINS.svg = function(svg, corner)
},
box, mtx, root, point, tPoint;

// Ascend the parentNode chain until we find an element with getBBox()
while(!elem.getBBox) { elem = elem.parentNode; }

// Check for a valid bounding box method
if (elem.getBBox && elem.parentNode) {
box = elem.getBBox();
mtx = elem.getScreenCTM();
Expand Down

0 comments on commit 2d4f050

Please sign in to comment.