Skip to content

Visualize Your Ideas With Code

fix(2d): support tweening emojis (#1085)

Jacob4a01a3abfbcc
diff --git a/packages/core/src/tweening/interpolationFunctions.ts b/packages/core/src/tweening/interpolationFunctions.ts
index 32593977..4c9cbcb5 100644
--- a/packages/core/src/tweening/interpolationFunctions.ts
+++ b/packages/core/src/tweening/interpolationFunctions.ts
@@ -5,7 +5,10 @@ export interface InterpolationFunction<T, TRest extends any[] = any[]> {
(from: T, to: T, value: number, ...args: TRest): T;
}
-export function textLerp(from: string, to: string, value: number) {
+export function textLerp(fromString: string, toString: string, value: number) {
+ const from = [...fromString];
+ const to = [...toString];
+
// left to right
if (to.length >= from.length) {
const current = Math.floor(to.length * value);