Repository navigation
fix: size paint brushes in voxels - #981
Conversation
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
c610eea to
a888c96
Compare
PaulHax
left a comment
There was a problem hiding this comment.
Hopeing we can smplify all this work
| let checkIfPointerInView = false; | ||
| const pointerInView = ref(false); | ||
| watch( | ||
| [() => paintStore.brushSize, imageMetadata, viewAxisIndex, pointerInView], |
There was a problem hiding this comment.
We really should prefer watch effect over these manual watch definitions. It needs to be justified.
| max="50" | ||
| step="1" | ||
| /> | ||
| <div class="brush-size-control"> |
There was a problem hiding this comment.
This whole change on this block seems a bit much just to get normal spacing. Why are we doing grid? Just to have a row with even spacing on the slider there. Seems like overkill, this whole big change here. Try to simplify this. Prefer Beautify utility classes, of course, to avoid, like, defining new classes if we don't have to.
| getBrushSizeLimit(currentImageMetadata.value.dimensions) | ||
| ); | ||
|
|
||
| watch([currentImageData, brushSizeMax], ([image, max]) => { |
There was a problem hiding this comment.
Again, we're defining the manual things to watch, prefer, watch effect, if it's even needed, you know.
3026109 to
2626597
Compare
2626597 to
da3acc8
Compare
Small voxels can make the minimum brush paint several voxels, while the fixed maximum of 50 ignores image dimensions. Measure brush diameter relative to the image's finest voxel spacing so size 1 paints a single voxel. Cap the size at 10% of the largest voxel dimension, rounded up with a minimum of 1, to keep small brushes easy to select.
Show the current value while dragging and explain the units. The slider, keyboard shortcuts, and modifier-wheel adjustments share the same integer limits, and the preview respects the image under the cursor.