utility function to find the biggest area: BKE_screen_find_big_area(...), was being...
[blender.git] / source / blender / editors / render / render_view.c
index 47957c0bb5ad8631193024a2d21e3c66d7f72fbd..d8719c7d7cdbae895f470468f6daa53d39596770 100644 (file)
@@ -58,6 +58,7 @@
 
 /* returns biggest area that is not uv/image editor. Note that it uses buttons */
 /* window as the last possible alternative.                                                                       */
+/* would use BKE_screen_find_big_area(...) but this is too specific            */
 static ScrArea *biggest_non_image_area(bContext *C)
 {
        bScreen *sc= CTX_wm_screen(C);
@@ -85,22 +86,6 @@ static ScrArea *biggest_non_image_area(bContext *C)
        return big;
 }
 
-static ScrArea *biggest_area(bContext *C)
-{
-       bScreen *sc= CTX_wm_screen(C);
-       ScrArea *sa, *big= NULL;
-       int size, maxsize= 0;
-
-       for(sa= sc->areabase.first; sa; sa= sa->next) {
-               size= sa->winx*sa->winy;
-               if(size > maxsize) {
-                       maxsize= size;
-                       big= sa;
-               }
-       }
-       return big;
-}
-
 static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win)
 {
        wmWindowManager *wm= CTX_wm_manager(C);
@@ -206,7 +191,7 @@ void render_view_open(bContext *C, int mx, int my)
                        }
                        else {
                                /* use any area of decent size */
-                               sa= biggest_area(C);
+                               sa= BKE_screen_find_big_area(CTX_wm_screen(C), -1, 0);
                                if(sa->spacetype!=SPACE_IMAGE) {
                                        // XXX newspace(sa, SPACE_IMAGE);
                                        sima= sa->spacedata.first;