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:
authorCharlie Jolly <mistajolly@gmail.com>2019-01-18 18:50:16 +0300
committerCharlie Jolly <mistajolly@gmail.com>2019-01-18 18:50:16 +0300
commit985dcbf6db1199dc247a2c6bb13c380035a613e6 (patch)
tree7e0e48c91ffa3d2b8e04ecc7715fa1a1b4e84e60 /source/blender/editors/gpencil
parentb5bc2158a07140e5463e209839bcf36d2ce2cddc (diff)
GP: Guides: Fix bug with Mkey and Circular guides
Reported by @pepeland. Adding missing events on the first point was breaking the guide behaviour. Also, updated Ckey so it always defaults to Circular mode when guides are off.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 46b3d539477..eaa5345eae1 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3069,8 +3069,11 @@ static void gpencil_guide_event_handling(bContext *C, wmOperator *op, const wmEv
/* Point guide */
else if ((event->type == CKEY) && (event->val == KM_RELEASE)) {
add_notifier = true;
- guide->use_guide = true;
- if (guide->type == GP_GUIDE_CIRCULAR) {
+ if (!guide->use_guide) {
+ guide->use_guide = true;
+ guide->type = GP_GUIDE_CIRCULAR;
+ }
+ else if (guide->type == GP_GUIDE_CIRCULAR) {
guide->type = GP_GUIDE_RADIAL;
}
else if (guide->type == GP_GUIDE_RADIAL) {
@@ -3632,7 +3635,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* handle drawing event */
/* printf("\t\tGP - add point\n"); */
- gpencil_add_missing_events(C, op, event, p);
+ if ((!(p->flags & GP_PAINTFLAG_FIRSTRUN)) && guide->use_guide) {
+ gpencil_add_missing_events(C, op, event, p);
+ }
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), 0.0f, 0.0f);