Skip to content

Commit 7424b43

Browse files
committed
Make the svg element detection more general
1 parent 94e1a2e commit 7424b43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/sigma.utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@
632632
* @return {object} The center of the event's target.
633633
*/
634634
sigma.utils.getCenter = function(e) {
635-
var ratio = e.target.getAttribute('class') == 'sigma-svg' ? 1 :
635+
var ratio = e.target.namespaceURI.indexOf('svg') !== -1 ? 1 :
636636
sigma.utils.getPixelRatio();
637637
return {
638638
x: sigma.utils.getWidth(e) / (2 * ratio),

0 commit comments

Comments
 (0)