diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-20 22:01:35 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-20 22:03:23 +0300 |
commit | 3d9d132ccd4511308fbeb2d1ac323ed028a4cd9f (patch) | |
tree | e4dbbb944c2c6483d4662be794a3309626f42c42 /source/blender/editors/transform/transform_generics.c | |
parent | a696053545e9e5c50302da668b9fd2f7c8edc605 (diff) |
GPencil: Fix unreported slow transform with proportional edition
Now a hash is used to avoid double update of the same stroke. The old method was not correct with proportional edition.
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index cb7071e0f49..7a787b77a62 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -47,6 +47,7 @@ #include "DNA_view3d_types.h" #include "BLI_blenlib.h" +#include "BLI_ghash.h" #include "BLI_math.h" #include "BLI_rand.h" #include "BLI_utildefines.h" @@ -1149,17 +1150,19 @@ static void recalcData_sequencer(TransInfo *t) static void recalcData_gpencil_strokes(TransInfo *t) { TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); - bGPDstroke *gps_prev = NULL; + GHash *strokes = BLI_ghash_ptr_new(__func__); TransData *td = tc->data; for (int i = 0; i < tc->data_len; i++, td++) { bGPDstroke *gps = td->extra; - if ((gps != NULL) && (gps != gps_prev)) { + + if ((gps != NULL) && (!BLI_ghash_haskey(strokes, gps))) { + BLI_ghash_insert(strokes, gps, gps); /* Calc geometry data. */ BKE_gpencil_stroke_geometry_update(gps); - gps_prev = gps; } } + BLI_ghash_free(strokes, NULL, NULL); } static void recalcData_sculpt(TransInfo *t) |