GPv3: Soft mode for the Eraser tool #110310

Merged
Falk David merged 61 commits from amelief/blender:gpv3-erase-operator-soft-mode into main 2024-08-20 17:24:21 +02:00
Showing only changes of commit 4b1a297bd9 - Show all commits

View File

@ -854,10 +854,10 @@ struct EraseOperationExecutor {
/* First, distance-based sampling with a small pixel distance.
* The samples are stored in increasing radius order. */
const int64_t step_pixels = 2;
int nb_samples = round_fl_to_int(this->eraser_radius / step_pixels) + 1;
int nb_samples = round_fl_to_int(this->eraser_radius / step_pixels);
Vector<EraserRing> eraser_rings(nb_samples);
for (const int sample_index : IndexRange(nb_samples)) {
const int64_t sampled_distance = math::max(sample_index * step_pixels, int64_t(1));
for (const int sample_index : eraser_rings.index_range()) {
const int64_t sampled_distance = (sample_index + 1) * step_pixels;
EraserRing &ring = eraser_rings[sample_index];
ring.radius = sampled_distance;