Skip to content

Instantly share code, notes, and snippets.

View engray's full-sized avatar

Matthias engray

View GitHub Profile
@brunnolou
brunnolou / svg-transform-origin-absolute.js
Created August 31, 2015 13:31
Calculate SVG absolute `transform-origin` position to be compatible with firefox
var element = document.querySelector(prompt('Insert the querySelector to the svg element.', '#gear'));
var bbox = element.getBBox(),
x = bbox.x,
y = bbox.y,
w = bbox.width,
h = bbox.height
;
var result =
'center center' + "\n" +