From 8e2034d5ef3dcdfbc69feebd29e152776fb58693 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 13 Apr 2026 22:26:42 +0200 Subject: [PATCH] Update path rendering logic in viewport-host.ts --- src/viewport-three/viewport-host.ts | 30 ++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index e997bf83..d7e4098e 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -3209,6 +3209,10 @@ export class ViewportHost { )) { this.applyModelInstanceRenderObjectTransform(modelInstance); } + + for (const path of getScenePaths(this.currentDocument.paths)) { + this.updatePathRenderObjectState(path); + } } private applyTransformPreview() { @@ -5237,22 +5241,38 @@ export class ViewportHost { } const selected = isPathSelected(this.currentSelection, path.id); - const hovered = - this.hoveredSelection.kind === "paths" && - this.hoveredSelection.ids.includes(path.id); + const hovered = isPathSelected(this.hoveredSelection, path.id); renderObjects.line.material.color.setHex( selected ? PATH_SELECTED_COLOR : hovered ? PATH_HOVERED_COLOR : PATH_COLOR ); for (const pointMesh of renderObjects.pointMeshes) { + const pointSelected = isPathPointSelected( + this.currentSelection, + path.id, + pointMesh.pointId + ); + const pointHovered = isPathPointSelected( + this.hoveredSelection, + path.id, + pointMesh.pointId + ); + pointMesh.mesh.material.color.setHex( - selected + pointSelected ? PATH_POINT_SELECTED_COLOR - : hovered + : pointHovered || selected ? PATH_POINT_HOVERED_COLOR : PATH_POINT_COLOR ); + pointMesh.mesh.scale.setScalar( + pointSelected + ? PATH_POINT_SELECTED_SCALE + : pointHovered + ? PATH_POINT_HOVERED_SCALE + : 1 + ); } } }