diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-25 01:37:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-25 02:40:52 +0400 |
commit | d305df2226ccdf371d127d1c4f39690042f483bd (patch) | |
tree | 320b2bd0c33b100f9df44854374101704243e624 /source/blender/blenkernel/intern/screen.c | |
parent | 710f3746fcb4c599b7f833e5df66371566caa56b (diff) |
Transform: old todo, removing an orientation now checks all screens.
also fix for using uninitialized matrix when an out-of-range index is
set for custom orientations.
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index c41c66ef561..5b1bb7854a5 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -417,7 +417,7 @@ ScrArea *BKE_screen_find_big_area(bScreen *sc, const int spacetype, const short return big; } -void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene) +void BKE_screen_view3d_sync(View3D *v3d, struct Scene *scene) { int bit; @@ -481,6 +481,37 @@ void BKE_screen_view3d_main_sync(ListBase *screen_lb, Scene *scene) } } +void BKE_screen_view3d_twmode_remove(View3D *v3d, const int i) +{ + const int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); + if (selected_index == i) { + v3d->twmode = V3D_MANIP_GLOBAL; /* fallback to global */ + } + else if (selected_index > i) { + v3d->twmode--; + } +} + +void BKE_screen_view3d_main_twmode_remove(ListBase *screen_lb, Scene *scene, const int i) +{ + bScreen *sc; + + for (sc = screen_lb->first; sc; sc = sc->id.next) { + if (sc->scene == scene) { + ScrArea *sa; + for (sa = sc->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + for (sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_VIEW3D) { + View3D *v3d = (View3D *)sl; + BKE_screen_view3d_twmode_remove(v3d, i); + } + } + } + } + } +} + /* magic zoom calculation, no idea what * it signifies, if you find out, tell me! -zr */ |