Skip to content

Commit

Permalink
Fix Chrome 0.48 issue
Browse files Browse the repository at this point in the history
Apparently chrome removed SVGElement.prototype.getTransformToElement,
which is used by dagre-d3 when creating edges. This commit is taken
from a fix in the main repo:
dagrejs@1ef067f

dagrejs#202
  • Loading branch information
Andrew Or committed Jan 29, 2016
1 parent 6db19e9 commit 7d6c000
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/create-edge-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ function createLine(edge, points) {

function getCoords(elem) {
var bbox = elem.getBBox(),
matrix = elem.getTransformToElement(elem.ownerSVGElement)
matrix = elem.ownerSVGElement.getScreenCTM()
.inverse()
.multiply(elem.getScreenCTM())
.translate(bbox.width / 2, bbox.height / 2);
return { x: matrix.e, y: matrix.f };
}
Expand Down

1 comment on commit 7d6c000

@jrgleason
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Please sign in to comment.