From 34b1799b2165ea78a0a0e43efd786346dc05c943 Mon Sep 17 00:00:00 2001 From: Kelly Yang <124ykl@gmail.com> Date: Thu, 12 Mar 2026 09:01:44 -0700 Subject: [PATCH] feat/mask-editor-brush-step-size (#9730) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Fix #9727 FYI #9534 ## GIMP Source Accroding to GIMP( like open-source Adobe Photoshop)`/composables/maskeditor/useBrushDrawing.ts`, ``` const brushStepSizeSliderValue = computed({ get: () => { if (rawStepSizeSliderValue.value !== null) { const cachedSize = Math.round(Math.pow(100, rawStepSizeSliderValue.value)) if (cachedSize === brushStepSize.value) { return rawStepSizeSliderValue.value } } return Math.log(brushStepSize.value) / Math.log(100) }, set: (value: number) => { rawStepSizeSliderValue.value = value const size = Math.round(Math.pow(100, value)) store.setBrushStepSize(size) } }) ``` ## Screenshot https://github.com/user-attachments/assets/971e7bd9-9690-475f-b214-33d06939d2ef ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9730-feat-mask-editor-brush-step-size-3206d73d36508198b934e0fb374eb5a9) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne --- src/composables/maskeditor/useBrushDrawing.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/composables/maskeditor/useBrushDrawing.ts b/src/composables/maskeditor/useBrushDrawing.ts index f1ea0fb38c..79d40a5d31 100644 --- a/src/composables/maskeditor/useBrushDrawing.ts +++ b/src/composables/maskeditor/useBrushDrawing.ts @@ -924,7 +924,8 @@ export function useBrushDrawing(initialSettings?: { } // Calculate target spacing based on step size percentage - const stepPercentage = store.brushSettings.stepSize / 100 + const stepPercentage = + Math.pow(100, store.brushSettings.stepSize / 100) / 100 const targetSpacing = Math.max( 1.0, store.brushSettings.size * stepPercentage @@ -1483,7 +1484,8 @@ export function useBrushDrawing(initialSettings?: { const dist = Math.hypot(p2.x - p1.x, p2.y - p1.y) // Calculate target spacing based on stepSize - const stepPercentage = store.brushSettings.stepSize / 100 + const stepPercentage = + Math.pow(100, store.brushSettings.stepSize / 100) / 100 const stepSize = Math.max( 1.0, store.brushSettings.size * stepPercentage