Fix T87082: Smooth thickness not working

When using the smooth operator, the thickness would not be
smoothed on the first iteration. This was becasue the inner loop
was set to run `r * 20` times but `r` starts at 0.

The fix makes sure that "Smooth Thickness" works on the first
iteration by using  a fixed value of `20` as the loop limit. This
makes sure that for every iteration, we run the smoothing of the
thickness 20 more times.

Reviewed By: antoniov

Maniphest Tasks: T87082

Differential Revision: https://developer.blender.org/D10867
This commit is contained in:
Falk David 2021-03-31 14:18:41 +02:00
parent f02e1a77c9
commit 8d45a96789
Notes: blender-bot 2023-09-08 04:55:43 +02:00
Referenced by issue #87082, Smooth Stroke function in Grease Pencil not affecting Thickness of stroke when Repeat has value of 1
1 changed files with 1 additions and 1 deletions

View File

@ -3951,7 +3951,7 @@ static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
}
if (smooth_thickness) {
/* thickness need to repeat process several times */
for (int r2 = 0; r2 < r * 20; r2++) {
for (int r2 = 0; r2 < 20; r2++) {
BKE_gpencil_stroke_smooth_thickness(gps, i, factor);
}
}