Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_sculpt_paint.c
| Show First 20 Lines • Show All 1,804 Lines • ▼ Show 20 Lines | static void gpencil_sculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) | ||||
| int mouse[2]; | int mouse[2]; | ||||
| bool changed = false; | bool changed = false; | ||||
| /* Get latest mouse coordinates */ | /* Get latest mouse coordinates */ | ||||
| RNA_float_get_array(itemptr, "mouse", mousef); | RNA_float_get_array(itemptr, "mouse", mousef); | ||||
| gso->mval[0] = mouse[0] = (int)(mousef[0]); | gso->mval[0] = mouse[0] = (int)(mousef[0]); | ||||
| gso->mval[1] = mouse[1] = (int)(mousef[1]); | gso->mval[1] = mouse[1] = (int)(mousef[1]); | ||||
| /* If the mouse/pen has not moved, no reason to continue. This also avoid a small | |||||
| * drift due precision acumulation errors. */ | |||||
| if ((gso->mval[0] == gso->mval_prev[0]) && (gso->mval[1] == gso->mval_prev[1])) { | |||||
| return; | |||||
| } | |||||
| gso->pressure = RNA_float_get(itemptr, "pressure"); | gso->pressure = RNA_float_get(itemptr, "pressure"); | ||||
| if (RNA_boolean_get(itemptr, "pen_flip")) { | if (RNA_boolean_get(itemptr, "pen_flip")) { | ||||
| gso->flag |= GP_SCULPT_FLAG_INVERT; | gso->flag |= GP_SCULPT_FLAG_INVERT; | ||||
| } | } | ||||
| else { | else { | ||||
| gso->flag &= ~GP_SCULPT_FLAG_INVERT; | gso->flag &= ~GP_SCULPT_FLAG_INVERT; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 341 Lines • Show Last 20 Lines | |||||