From 203aa93137ff3a2d0c0a09ed648fe37875bb5e1e Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 5 Apr 2026 02:25:42 +0200 Subject: [PATCH] Refactor box face UV projection to remove unused import and simplify halfSize calculation --- src/geometry/box-face-uvs.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/geometry/box-face-uvs.ts b/src/geometry/box-face-uvs.ts index 74955792..9106962c 100644 --- a/src/geometry/box-face-uvs.ts +++ b/src/geometry/box-face-uvs.ts @@ -2,7 +2,6 @@ import { BoxGeometry } from "three"; import type { Vec2, Vec3 } from "../core/vector"; import { BOX_FACE_IDS, createDefaultFaceUvState, type BoxBrush, type BoxFaceId, type FaceUvState } from "../document/brushes"; -import { getBoxBrushHalfSize } from "./box-brush"; interface BoxBrushUvProjectionSource { size: Vec3; @@ -45,7 +44,11 @@ export function createFitToFaceBoxBrushFaceUvState(brush: BoxBrush, faceId: BoxF } export function projectBoxFaceVertexToUv(vertexPosition: Vec3, brush: BoxBrushUvProjectionSource, faceId: BoxFaceId): Vec2 { - const halfSize = getBoxBrushHalfSize(brush); + const halfSize = { + x: brush.size.x * 0.5, + y: brush.size.y * 0.5, + z: brush.size.z * 0.5 + }; switch (faceId) { case "posX":