You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when text on the path is centered it is using this part of the code: /* Center text according to the path's bounding box */ if (options.center) { var textLength = textNode.getComputedTextLength(); var pathLength = this._path.getTotalLength(); /* Set the position for the left side of the textNode */ textNode.setAttribute('dx', ((pathLength / 2) - (textLength / 2))); }
the getComputedTextLength() & getTotalLength() cause reflows in the browser and are very slow when a lot of text is added. I've tried replacing this and came up with adding these attributes to the path-element and remove the above code:
I have a similar issue with the 'repeat' option, which I see uses the same slow function calls. I can't see a way to remove these though. Any ideas? @TheCollector2K ?
when text on the path is centered it is using this part of the code:
/* Center text according to the path's bounding box */ if (options.center) { var textLength = textNode.getComputedTextLength(); var pathLength = this._path.getTotalLength(); /* Set the position for the left side of the textNode */ textNode.setAttribute('dx', ((pathLength / 2) - (textLength / 2))); }
the getComputedTextLength() & getTotalLength() cause reflows in the browser and are very slow when a lot of text is added. I've tried replacing this and came up with adding these attributes to the path-element and remove the above code:
textPath.setAttribute('text-anchor', 'middle'); textPath.setAttribute('startOffset', '50%');
Maybe someone could check and (when it's ok) add it to the code.
The text was updated successfully, but these errors were encountered: