code cleanup: use const events for modal and invoke operators.
[blender.git] / source / blender / editors / sculpt_paint / paint_utils.c
index dc3f310b4052e097b210fb77a0510753312290db..19c061996e733d1e2f5f2a41a045c68a5526ecb0 100644 (file)
@@ -160,12 +160,12 @@ float paint_calc_object_space_radius(ViewContext *vc, const float center[3],
        Object *ob = vc->obact;
        float delta[3], scale, loc[3];
        const float mval_f[2] = {pixel_radius, 0.0f};
+       float zfac;
 
        mul_v3_m4v3(loc, ob->obmat, center);
 
-       initgrabz(vc->rv3d, loc[0], loc[1], loc[2]);
-
-       ED_view3d_win_to_delta(vc->ar, mval_f, delta);
+       zfac = ED_view3d_calc_zfac(vc->rv3d, loc, NULL);
+       ED_view3d_win_to_delta(vc->ar, mval_f, delta, zfac);
 
        scale = fabsf(mat4_to_scale(ob->obmat));
        scale = (scale == 0.0f) ? 1.0f : scale;
@@ -414,7 +414,7 @@ void PAINT_OT_face_select_linked(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
        int mode = RNA_boolean_get(op->ptr, "extend") ? 1 : 0;
        paintface_select_linked(C, CTX_data_active_object(C), event->mval, mode);