[Bf-blender-cvs] [8a3528a8b6b] temp-npr-gpencil-modifiers: Gpencil: Fix code styles and revert BLI_map.h
YimingWu
noreply at git.blender.org
Thu Oct 10 11:22:07 CEST 2019
Commit: 8a3528a8b6b105558dc3f72484915567989c7203
Author: YimingWu
Date: Thu Oct 10 17:12:52 2019 +0800
Branches: temp-npr-gpencil-modifiers
https://developer.blender.org/rB8a3528a8b6b105558dc3f72484915567989c7203
Gpencil: Fix code styles and revert BLI_map.h
===================================================================
M source/blender/blenkernel/intern/gpencil.c
M source/blender/blenlib/BLI_map.h
M source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
===================================================================
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index cfee019b21c..d5d7d8e34af 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1429,9 +1429,6 @@ void BKE_gpencil_vgroup_remove(Object *ob, bDeformGroup *defgroup)
/* Remove the group */
BLI_freelinkN(&ob->defbase, defgroup);
- if (gpd) {
- DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
- }
}
void BKE_gpencil_dvert_ensure(bGPDstroke *gps)
diff --git a/source/blender/blenlib/BLI_map.h b/source/blender/blenlib/BLI_map.h
index 3e934480b94..1edf7653c71 100644
--- a/source/blender/blenlib/BLI_map.h
+++ b/source/blender/blenlib/BLI_map.h
@@ -624,15 +624,16 @@ template<typename KeyT, typename ValueT, typename Allocator = GuardedAllocator>
template<typename ForwardKeyT, typename ForwardValueT>
bool add_override__impl(ForwardKeyT &&key, ForwardValueT &&value)
{
- return this->add_or_modify(std::forward<ForwardKeyT>(key),
- [&](ValueT *dst) {
- new (dst) ValueT(std::forward<ForwardValueT>(value));
- return true;
- },
- [&](ValueT *old_value) {
- *old_value = std::forward<ForwardValueT>(value);
- return false;
- });
+ return this->add_or_modify(
+ std::forward<ForwardKeyT>(key),
+ [&](ValueT *dst) {
+ new (dst) ValueT(std::forward<ForwardValueT>(value));
+ return true;
+ },
+ [&](ValueT *old_value) {
+ *old_value = std::forward<ForwardValueT>(value);
+ return false;
+ });
}
template<typename ForwardKeyT, typename ForwardValueT>
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
index eccf48873e7..f24a5fc135d 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c
@@ -73,7 +73,7 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
static void stretchOrShrinkStroke(bGPDstroke *gps, float length)
{
- if (length > 0) {
+ if (length > 0.0f) {
BKE_gpencil_stretch_stroke(gps, length);
}
else {
@@ -86,7 +86,7 @@ static void applyLength(bGPDstroke *gps, float length, float percentage)
stretchOrShrinkStroke(gps, length);
- float len = BKE_gpencil_stroke_length(gps, 1);
+ float len = BKE_gpencil_stroke_length(gps, true);
if (len < FLT_EPSILON) {
return;
}
More information about the Bf-blender-cvs
mailing list