This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Polyfill SVG path support for iOS | |
*/ | |
SVGCircleElement.prototype.getTotalLength = function() { | |
let width = this.parentNode.clientWidth, // Get the parent node width (trying to get the current node width returns 0) | |
radius = width / 2, // Get the radius by dividing by 2 | |
length = 2 * Math.PI * radius; // Get the circumference from 2πr | |
// Return the calculated value | |
return length; |