Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/annotate_paint.c
| Show First 20 Lines • Show All 1,780 Lines • ▼ Show 20 Lines | |||||
| /* handle draw event */ | /* handle draw event */ | ||||
| static void annotation_draw_apply_event(wmOperator *op, const wmEvent *event, Depsgraph *depsgraph, float x, float y) | static void annotation_draw_apply_event(wmOperator *op, const wmEvent *event, Depsgraph *depsgraph, float x, float y) | ||||
| { | { | ||||
| tGPsdata *p = op->customdata; | tGPsdata *p = op->customdata; | ||||
| PointerRNA itemptr; | PointerRNA itemptr; | ||||
| float mousef[2]; | float mousef[2]; | ||||
| int tablet = 0; | int tablet = 0; | ||||
| /* convert from window-space to area-space mouse coordinates | /* convert from window-space to area-space mouse coordinates | ||||
| * add any x,y override position for fake events | * add any x,y override position for fake events | ||||
| */ | */ | ||||
| p->mval[0] = (float)event->mval[0] - x; | p->mval[0] = (float)event->mval[0] - x; | ||||
| p->mval[1] = (float)event->mval[1] - y; | p->mval[1] = (float)event->mval[1] - y; | ||||
| /* verify key status for straight lines */ | /* verify key status for straight lines */ | ||||
| if ((event->ctrl > 0) || (event->alt > 0)) { | if ((event->ctrl > 0) || (event->alt > 0)) { | ||||
| if (p->straight[0] == 0) { | if (p->straight[0] == 0) { | ||||
| int dx = abs((int)(p->mval[0] - p->mvalo[0])); | int dx = abs((int)(p->mval[0] - p->mvalo[0])); | ||||
| int dy = abs((int)(p->mval[1] - p->mvalo[1])); | int dy = abs((int)(p->mval[1] - p->mvalo[1])); | ||||
| ▲ Show 20 Lines • Show All 692 Lines • Show Last 20 Lines | |||||