diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-09 15:40:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-09 15:40:42 +0400 |
commit | abd1748e486e0948df26fb7a0cf42bce67f861ec (patch) | |
tree | 8d5510d29295a07e710971ec088dce424de6ea6e /source/blender/editors/physics | |
parent | e2ddd832dcdd890bc7d5ca29b1d8c3ec5848c620 (diff) |
code cleanup: move runtime var zfac out of RegionView3D. rename initgrabz() -> ED_view3d_calc_zfac() and have it return the zfac to use.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 31079de275e..111f3a0cb10 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3476,6 +3476,7 @@ typedef struct BrushEdit { int first; int lastmouse[2]; + float zfac; /* optional cached view settings to avoid setting on every mousemove */ PEData data; @@ -3498,7 +3499,6 @@ static int brush_edit_init(bContext *C, wmOperator *op) INIT_MINMAX(min, max); PE_minmax(scene, min, max); mid_v3_v3v3(min, min, max); - initgrabz(ar->regiondata, min[0], min[1], min[2]); bedit= MEM_callocN(sizeof(BrushEdit), "BrushEdit"); bedit->first= 1; @@ -3508,6 +3508,8 @@ static int brush_edit_init(bContext *C, wmOperator *op) bedit->ob= ob; bedit->edit= edit; + bedit->zfac = ED_view3d_calc_zfac(ar->regiondata, min, NULL); + /* cache view depths and settings for re-use */ PE_set_view3d_data(C, &bedit->data); @@ -3587,7 +3589,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) invert_m4_m4(ob->imat, ob->obmat); - ED_view3d_win_to_delta(ar, mval_f, vec); + ED_view3d_win_to_delta(ar, mval_f, vec, bedit->zfac); data.dvec= vec; foreach_mouse_hit_key(&data, brush_comb, selected); |