diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-22 04:02:11 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-22 04:02:11 +0300 |
commit | 2c565ec48a784d1bcd2325a2c5d79ce31c9fdb0d (patch) | |
tree | ec6b35308008f73f5be7a651bc92202c2d844643 | |
parent | 3e95d9cf6588e404ad3e7a55660e3e52afac9533 (diff) |
Fix [#20538] exiting render turns my UV/image editor back to a 3d view
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 32f6ba0ce85..0b26b531d89 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2774,6 +2774,7 @@ static void screen_set_image_output(bContext *C, int mx, int my) Scene *scene= CTX_data_scene(C); ScrArea *sa= NULL; SpaceImage *sima; + int area_was_image=0; if(scene->r.displaymode==R_OUTPUT_WINDOW) { rcti rect; @@ -2798,6 +2799,9 @@ static void screen_set_image_output(bContext *C, int mx, int my) sa= CTX_wm_area(C); } else if(scene->r.displaymode==R_OUTPUT_SCREEN) { + if (CTX_wm_area(C)->spacetype == SPACE_IMAGE) + area_was_image = 1; + /* this function returns with changed context */ ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE); sa= CTX_wm_area(C); @@ -2836,14 +2840,24 @@ static void screen_set_image_output(bContext *C, int mx, int my) /* get the correct image, and scale it */ sima->image= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); - // if(G.displaymode==2) { // XXX + + /* if we're rendering to full screen, set appropriate hints on image editor + * so it can restore properly on pressing esc */ if(sa->full) { - sima->flag |= SI_FULLWINDOW|SI_PREVSPACE; + sima->flag |= SI_FULLWINDOW; + + /* Tell the image editor to revert to previous space in space list on close + * _only_ if it wasn't already an image editor when the render was invoked */ + if (area_was_image == 0) + sima->flag |= SI_PREVSPACE; + else { + /* Leave it alone so the image editor will just go back from + * full screen to the original tiled setup */ + ; + } - // ed_screen_fullarea(C, win, sa); } - // } - + } /* executes blocking render */ |