From 9b9cc8fab897a5b1754b2ff1f1055f7e84c9aa83 Mon Sep 17 00:00:00 2001 From: MelekTaus Moribundus Date: Wed, 1 Jul 2026 22:11:27 +0200 Subject: [PATCH] Scale Shift+wheel brush resize geometrically Replace the fixed additive brush-size step with a fraction of the current size, so small brushes resize a texel at a time (fine control) while large ones jump in bigger increments. Always moves at least one texel per notch. Co-Authored-By: Claude Opus 4.8 --- Assets/Scripts/MeshPainter.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/MeshPainter.cs b/Assets/Scripts/MeshPainter.cs index dd539d0..16e70f8 100644 --- a/Assets/Scripts/MeshPainter.cs +++ b/Assets/Scripts/MeshPainter.cs @@ -204,8 +204,11 @@ public partial class MeshPainter : MonoBehaviour [Range(1, 256)] public int brushSize = 16; - [Tooltip("Texels added/removed per mouse-wheel notch while Shift is held (paint mode brush resize).")] - public int brushSizeScrollStep = 4; + [Tooltip("Fraction of the current brush size added/removed per mouse-wheel notch while Shift is held. " + + "The step scales with the size, so small brushes resize slowly (fine control) and large ones " + + "resize faster. Always moves at least one texel per notch.")] + [Range(0.01f, 1f)] + public float brushSizeScrollFactor = 0.15f; /// /// Raised after Shift+wheel changes so the in-game HUD can re-sync its @@ -1108,7 +1111,9 @@ public partial class MeshPainter : MonoBehaviour float scroll = ReadScroll(); if (Mathf.Approximately(scroll, 0f)) return; - int step = Mathf.Max(1, brushSizeScrollStep); + // Geometric resize: the step scales with the current size, so small brushes change a texel + // at a time (fine control) while large brushes jump in bigger increments. Min one texel. + int step = Mathf.Max(1, Mathf.RoundToInt(brushSize * brushSizeScrollFactor)); int next = Mathf.Clamp(brushSize + (int)Mathf.Sign(scroll) * step, 1, 256); if (next == brushSize) return;