Skip to content

Commit 5124cc7

Browse files
committed
prevent multiple layouts when invalidated
1 parent a5d1211 commit 5124cc7

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

dist/circletype.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "circletype",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"description": "A JavaScript library that lets you curve type on the web.",
55
"main": "dist/circletype.min.js",
66
"files": [

src/class.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ class CircleType {
184184
* @return {CircleType} This instance.
185185
*/
186186
_invalidate() {
187-
requestAnimationFrame(() => {
187+
cancelAnimationFrame(this._raf);
188+
189+
this._raf = requestAnimationFrame(() => {
188190
this._layout();
189191
});
190192

0 commit comments

Comments
 (0)