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:
authorFalk David <falkdavid@gmx.de>2021-02-01 18:25:44 +0300
committerFalk David <falkdavid@gmx.de>2021-02-01 18:26:31 +0300
commit006e70dbd7e29c105809eded93169754ade03de5 (patch)
treebf40ac50199d818b7a013d6ad2f9e2d0ea6f7fd0 /source/blender/editors/gpencil/gpencil_primitive.c
parentc02f2d7371a11d1d0c575b42dc7dd790926a0877 (diff)
Fix T85203: GPencil: Drawing on locked axis plane
Drawing on e.g. the X-Z plane was broken due to an earlier commit (rBef28da262342). This was causing the projection when drawing on an axis plane to fail. The fix checks that the user is in view plane projection mode. Reviewed By: antoniov Maniphest Tasks: T85203 Differential Revision: https://developer.blender.org/D10252
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_primitive.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index a742d149fce..53e0043df37 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -713,8 +713,8 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
int depth_margin = (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 4 : 0;
const char align_flag = ts->gpencil_v3d_align;
bool is_depth = (bool)(align_flag & (GP_PROJECT_DEPTH_VIEW | GP_PROJECT_DEPTH_STROKE));
- const bool is_camera = (bool)(ts->gp_sculpt.lock_axis == 0) &&
- (tgpi->rv3d->persp == RV3D_CAMOB) && (!is_depth);
+ const bool is_lock_axis_view = (bool)(ts->gp_sculpt.lock_axis == 0);
+ const bool is_camera = is_lock_axis_view && (tgpi->rv3d->persp == RV3D_CAMOB) && (!is_depth);
if (tgpi->type == GP_STROKE_BOX) {
tgpi->tot_edges--;
@@ -1078,7 +1078,7 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
}
/* If camera view or view projection, reproject flat to view to avoid perspective effect. */
- if ((align_flag & GP_PROJECT_VIEWSPACE) || is_camera) {
+ if (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
ED_gpencil_project_stroke_to_view(C, tgpi->gpl, gps);
}