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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-07-18 13:56:10 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-07-18 13:56:10 +0400
commit997850aeccb1f2c9f83c592ca41793908e050202 (patch)
tree10967be0e89c6e4ea6c24b1ecb7d2506afb85d8d /source/blender/editors/mask
parent88fddb3cc34e0e1fe8da6f038f2ed377684b2ea9 (diff)
Fix #32132: Uniformly moving custom feather points does not work
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r--source/blender/editors/mask/mask_ops.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 902d065e87b..c8246fd53bc 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -375,7 +375,7 @@ typedef struct SlidePointData {
MaskSplinePointUW *uw;
float handle[2], no[2], feather[2];
int width, height;
- float weight;
+ float weight, weight_scalar;
short curvature_only, accurate;
short initial_feather, overall_feather;
@@ -460,6 +460,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event)
float weight_scalar = BKE_mask_point_weight_scalar(spline, point, uw->u);
customdata->weight = uw->w;
+ customdata->weight_scalar = weight_scalar;
BKE_mask_point_segment_co(spline, point, uw->u, co);
BKE_mask_point_normal(spline, point, uw->u, customdata->no);
@@ -469,6 +470,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event)
BezTriple *bezt = &point->bezt;
customdata->weight = bezt->weight;
+ customdata->weight_scalar = 1.0f;
BKE_mask_point_normal(spline, point, 0.0f, customdata->no);
madd_v2_v2v2fl(customdata->feather, bezt->vec[1], customdata->no, bezt->weight);
@@ -710,13 +712,13 @@ static int slide_point_modal(bContext *C, wmOperator *op, wmEvent *event)
if (dot_v2v2(no, vec) <= 0.0f)
w = -w;
- delta = w - data->weight;
+ delta = w - data->weight * data->weight_scalar;
if (data->orig_spline == NULL) {
/* restore weight for currently sliding point, so orig_spline would be created
* with original weights used
*/
- *weight = data->weight * weight_scalar;
+ *weight = data->weight;
data->orig_spline = BKE_mask_spline_copy(data->spline);
}