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:
authorCampbell Barton <campbell@blender.org>2022-07-06 14:04:30 +0300
committerThomas Dinges <blender@dingto.org>2022-07-15 15:51:14 +0300
commitcc5868234444098468f94aa7106c63ec3a386f28 (patch)
treeb52e44c514403e7e0a6fec4f7b4163cbfe20fc9a
parent3d6f6715595ea48004132d934c21f75eac85f51d (diff)
Fix T99368: Annotation lines doesn't start where clicked
Caused by [0] which made accessing the drag-start require a function instead of being the value written into the event cursor coordinates. [0]: b8960267dd51f9108b3b49e9b762e6b4d35ae1dc
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 8c393cc4f3f..2cae864d47f 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2062,11 +2062,18 @@ static void annotation_draw_apply_event(
PointerRNA itemptr;
float mousef[2];
- /* convert from window-space to area-space mouse coordinates
- * add any x,y override position for fake events
- */
- p->mval[0] = (float)event->mval[0] - x;
- p->mval[1] = (float)event->mval[1] - y;
+ /* Convert from window-space to area-space mouse coordinates
+ * add any x,y override position for fake events. */
+ if (p->flags & GP_PAINTFLAG_FIRSTRUN) {
+ /* The first run may be a drag event, see: T99368. */
+ WM_event_drag_start_mval_fl(event, p->region, p->mval);
+ p->mval[0] -= x;
+ p->mval[1] -= y;
+ }
+ else {
+ p->mval[0] = (float)event->mval[0] - x;
+ p->mval[1] = (float)event->mval[1] - y;
+ }
/* Key to toggle stabilization. */
if ((event->modifier & KM_SHIFT) && (p->paintmode == GP_PAINTMODE_DRAW)) {