From 9ed626aebb68025c2cc3157a9bf237e0a19cad23 Mon Sep 17 00:00:00 2001 From: CNCKitchen Date: Mon, 6 Apr 2026 13:42:28 +0200 Subject: [PATCH] perf: skip boundary falloff computation during active masking --- js/main.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 91de220..54a98bb 100644 --- a/js/main.js +++ b/js/main.js @@ -755,6 +755,12 @@ function setExclusionTool(tool) { if (!exclusionTool) { isPainting = false; getControls().enabled = true; + // Recompute boundary falloff now that masking is done + if (_falloffDirty && currentGeometry) { + const activeGeo = (settings.useDisplacement && dispPreviewGeometry) + ? dispPreviewGeometry : currentGeometry; + updateFaceMask(activeGeo); + } } } @@ -1482,7 +1488,9 @@ function updateFaceMask(geometry) { addFaceNormals(geometry); } - if (_falloffDirty || geometry !== _falloffGeometry) { + // Skip expensive falloff recomputation while actively masking; + // it will be recalculated when the masking tool is deactivated. + if (!exclusionTool && (_falloffDirty || geometry !== _falloffGeometry)) { computeBoundaryFalloffAttr(geometry, maskArr); computeBoundaryEdges(geometry, maskArr); _falloffDirty = false;