diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-06-08 00:48:33 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-06-08 14:23:37 +0300 |
commit | e54fb1b8191ee41ce537c8e1d6bbf81fa5e0302d (patch) | |
tree | f09e64c3a7f94925f0729153e1eef707e5d8112d /source/blender/editors/transform/transform_convert_gpencil.c | |
parent | 826769d1c7b5b56124b45512feb70d2e8607c0f5 (diff) |
Cleanup: Move each recalcData to their respective TransData file
Diffstat (limited to 'source/blender/editors/transform/transform_convert_gpencil.c')
-rw-r--r-- | source/blender/editors/transform/transform_convert_gpencil.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_convert_gpencil.c b/source/blender/editors/transform/transform_convert_gpencil.c index 00b0eab90cd..2bfce9f8418 100644 --- a/source/blender/editors/transform/transform_convert_gpencil.c +++ b/source/blender/editors/transform/transform_convert_gpencil.c @@ -25,11 +25,13 @@ #include "MEM_guardedalloc.h" +#include "BLI_ghash.h" #include "BLI_math.h" #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_gpencil.h" +#include "BKE_gpencil_geom.h" #include "ED_gpencil.h" @@ -376,4 +378,23 @@ void createTransGPencil(bContext *C, TransInfo *t) } } +/* force recalculation of triangles during transformation */ +void recalcData_gpencil_strokes(TransInfo *t) +{ + TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); + 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) && (!BLI_ghash_haskey(strokes, gps))) { + BLI_ghash_insert(strokes, gps, gps); + /* Calc geometry data. */ + BKE_gpencil_stroke_geometry_update(gps); + } + } + BLI_ghash_free(strokes, NULL, NULL); +} + /** \} */ |