diff options
author | Antonioya <blendergit@gmail.com> | 2018-11-01 18:42:34 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-11-01 19:05:04 +0300 |
commit | 1237e50c9ba9a023ddb118ed9d1eedc1e5d7c08e (patch) | |
tree | 3bd3d306bbf0d6344b732c4ea362a6e7a1444e51 /source/blender/editors/gpencil | |
parent | e6da49295c0d3bffbddbffece1964b556246f138 (diff) |
GP: Reorganize origin popover and top area
- Draw on back buttons moves near mode
- zDepth offset moved from View Panel to Popover
- Target for Stroke mode moved to popover
- New First point snap mode
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 837b18d1e52..44d47d1354b 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1040,7 +1040,9 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) depth_arr[i] = 0.9999f; } else { - if (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_ENDPOINTS) { + if ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_ENDPOINTS) || + (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_FIRST)) + { int first_valid = 0; int last_valid = 0; @@ -1052,12 +1054,16 @@ static void gp_stroke_newfrombuffer(tGPsdata *p) first_valid = i; /* find last valid contact point */ - for (i = gpd->runtime.sbuffer_size - 1; i >= 0; i--) { - if (depth_arr[i] != FLT_MAX) - break; + if (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_FIRST) { + last_valid = first_valid; + } + else { + for (i = gpd->runtime.sbuffer_size - 1; i >= 0; i--) { + if (depth_arr[i] != FLT_MAX) + break; + } + last_valid = i; } - last_valid = i; - /* invalidate any point other point, to interpolate between * first and last contact in an imaginary line between them */ for (i = 0; i < gpd->runtime.sbuffer_size; i++) { |