Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Dick <hen-di@web.de>2022-03-14 13:11:22 +0300
committerHenrik Dick <hen-di@web.de>2022-03-14 13:11:22 +0300
commit4045b3d7b685aeeb6003d3f90b4a41f6337b6159 (patch)
tree9b8bdd4ff267bf3471b7cc20f987447e3722c3f8 /source/blender/gpencil_modifiers
parentbf5e9ef2df3e755069ba9a1ce06d375d670e139c (diff)
GPencil: Fix offset modifier negative scale thickness
If the scale in the offset modifier was set to a value lower than -1, the object would get mirrored. The problem was, that the thickness was set to 0 by that. This fix makes the thickness calculation only use the absolute values. Differential Revision: http://developer.blender.org/D14324
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
index 3aaa032ef70..95c3f2c161f 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
@@ -152,7 +152,7 @@ static void deformStroke(GpencilModifierData *md,
loc_eul_size_to_mat4(mat, loc, rot, scale);
/* Apply scale to thickness. */
- float unit_scale = (scale[0] + scale[1] + scale[2]) / 3.0f;
+ float unit_scale = (fabsf(scale[0]) + fabsf(scale[1]) + fabsf(scale[2])) / 3.0f;
pt->pressure *= unit_scale;
mul_m4_v3(mat, &pt->x);