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
path: root/source
diff options
context:
space:
mode:
authorHenrik Dick <hen-di@web.de>2022-03-29 17:22:52 +0300
committerHenrik Dick <hen-di@web.de>2022-03-29 17:22:52 +0300
commit0e0977f3e68b2ac1fd021b5dc6ca10e5b9a25da1 (patch)
treef027b36414f2e0557b1e94ddfe5635bffe8aca43 /source
parent810e225c260dfc2eac9c6b8bfd3271066dc0224b (diff)
GPencil: Fix sculpt mask ignoring one point strokes
The check for the selected status was missing in the case where the stroke one has one point. Differential Revision: http://developer.blender.org/D14490
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 1e7159392e2..7de579993c1 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1442,20 +1442,22 @@ static bool gpencil_sculpt_brush_do_stroke(tGP_BrushEditData *gso,
if (gps->totpoints == 1) {
bGPDspoint pt_temp;
pt = &gps->points[0];
- gpencil_point_to_parent_space(gps->points, diff_mat, &pt_temp);
- gpencil_point_to_xy(gsc, gps, &pt_temp, &pc1[0], &pc1[1]);
-
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- /* Do bound-box check first. */
- if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1])) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) {
- /* only check if point is inside */
- int mval_i[2];
- round_v2i_v2fl(mval_i, gso->mval);
- if (len_v2v2_int(mval_i, pc1) <= radius) {
- /* apply operation to this point */
- if (pt_active != NULL) {
- rot_eval = gpencil_sculpt_rotation_eval_get(gso, gps, pt, 0);
- changed = apply(gso, gps_active, rot_eval, 0, radius, pc1);
+ if (GPENCIL_ANY_SCULPT_MASK(gso->mask) && (pt->flag & GP_SPOINT_SELECT) != 0) {
+ gpencil_point_to_parent_space(gps->points, diff_mat, &pt_temp);
+ gpencil_point_to_xy(gsc, gps, &pt_temp, &pc1[0], &pc1[1]);
+
+ pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
+ /* Do bound-box check first. */
+ if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1])) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) {
+ /* only check if point is inside */
+ int mval_i[2];
+ round_v2i_v2fl(mval_i, gso->mval);
+ if (len_v2v2_int(mval_i, pc1) <= radius) {
+ /* apply operation to this point */
+ if (pt_active != NULL) {
+ rot_eval = gpencil_sculpt_rotation_eval_get(gso, gps, pt, 0);
+ changed = apply(gso, gps_active, rot_eval, 0, radius, pc1);
+ }
}
}
}