diff options
Diffstat (limited to 'source/blender/editors/transform/transform_mode_gpopacity.c')
-rw-r--r-- | source/blender/editors/transform/transform_mode_gpopacity.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_mode_gpopacity.c b/source/blender/editors/transform/transform_mode_gpopacity.c index 103eb17c273..e67c6c03481 100644 --- a/source/blender/editors/transform/transform_mode_gpopacity.c +++ b/source/blender/editors/transform/transform_mode_gpopacity.c @@ -29,6 +29,8 @@ #include "BKE_context.h" #include "BKE_unit.h" +#include "DNA_gpencil_types.h" + #include "ED_screen.h" #include "UI_interface.h" @@ -68,8 +70,16 @@ static void applyGPOpacity(TransInfo *t, const int UNUSED(mval[2])) BLI_snprintf(str, sizeof(str), TIP_("Opacity: %3f"), ratio); } + bool recalc = false; FOREACH_TRANS_DATA_CONTAINER (t, tc) { TransData *td = tc->data; + bGPdata *gpd = td->ob->data; + const bool is_curve_edit = (bool)GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd); + /* Only recalculate data when in curve edit mode. */ + if (is_curve_edit) { + recalc = true; + } + for (i = 0; i < tc->data_len; i++, td++) { if (td->flag & TD_SKIP) { continue; @@ -84,6 +94,10 @@ static void applyGPOpacity(TransInfo *t, const int UNUSED(mval[2])) } } + if (recalc) { + recalcData(t); + } + ED_area_status_text(t->area, str); } |