From b4a65eb7469bfc687394918e961c9ac3d966305d Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 26 Mar 2024 11:41:51 -0700 Subject: [PATCH] who lints ya, baby? --- src/vec2-impl.ts | 5 +++-- src/vec3-impl.ts | 5 +++-- src/vec4-impl.ts | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/vec2-impl.ts b/src/vec2-impl.ts index 82bddaa..2011d27 100644 --- a/src/vec2-impl.ts +++ b/src/vec2-impl.ts @@ -691,9 +691,10 @@ export function setLength(a: Vec2, len: number, dst?: Vec2) { export function truncate(a: Vec2, maxLen: number, dst?: Vec2) { dst = dst || new VecType(2); - if (length(a) > maxLen) + if (length(a) > maxLen) { return setLength(a, maxLen, dst); - + } + return copy(a, dst); } diff --git a/src/vec3-impl.ts b/src/vec3-impl.ts index 65fa3d9..7a9b564 100644 --- a/src/vec3-impl.ts +++ b/src/vec3-impl.ts @@ -907,9 +907,10 @@ export function setLength(a: Vec3, len: number, dst?: Vec3) { export function truncate(a: Vec3, maxLen: number, dst?: Vec3) { dst = dst || new VecType(3); - if (length(a) > maxLen) + if (length(a) > maxLen) { return setLength(a, maxLen, dst); - + } + return copy(a, dst); } diff --git a/src/vec4-impl.ts b/src/vec4-impl.ts index f370d0e..c5c52c2 100644 --- a/src/vec4-impl.ts +++ b/src/vec4-impl.ts @@ -657,9 +657,10 @@ export function setLength(a: Vec4, len: number, dst?: Vec4) { export function truncate(a: Vec4, maxLen: number, dst?: Vec4) { dst = dst || new VecType(4); - if (length(a) > maxLen) + if (length(a) > maxLen) { return setLength(a, maxLen, dst); - + } + return copy(a, dst); }