Jump to content
GreenSock

OSUblake

getTransformToElement removed in Chrome 48

Moderator Tag

Recommended Posts

FYI: The SVGGraphicsElement.getTransformToElement method was removed in Chrome 48. I just found out about this breaking change and have been fixing older code that used it the past couple of days. It seems that after it was removed from Chrome, they found out there was a lot more usage of this method than expected. It even broke Google Slides.

 

Such a shame too as this was the easiest way to figure out where something was that had multiple transforms applied to it.

 

If you've used this method before, you might want to go check out your code. Here's a polyfill that should work for most cases.

SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(toElement) {
  return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());  
};
  • Like 6
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×