Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-04 05:15:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-04 05:15:04 +0400
commit2d787e6e015e54e760086266415d66cad5d1edec (patch)
tree61371a53d945e133aba83063e7f32f47b8637e89 /source/blender/blenkernel/intern/screen.c
parent29575c9ac8c08ae264f06b6ce34fa606bb09bdab (diff)
utility function to find the biggest area: BKE_screen_find_big_area(...), was being done with static functions that were copied about.
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r--source/blender/blenkernel/intern/screen.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 02e6fe945f3..b7f49bbab47 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -351,6 +351,29 @@ ARegion *BKE_area_find_region_type(ScrArea *sa, int type)
return NULL;
}
+/* note, using this function is generally a last resort, you really want to be
+ * using the context when you can - campbell
+ * -1 for any type */
+struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min)
+{
+ ScrArea *sa, *big= NULL;
+ int size, maxsize= 0;
+
+ for(sa= sc->areabase.first; sa; sa= sa->next) {
+ if ((spacetype == -1) || sa->spacetype == spacetype) {
+ if (min >= sa->winx && min >= sa->winy) {
+ size= sa->winx*sa->winy;
+ if (size > maxsize) {
+ maxsize= size;
+ big= sa;
+ }
+ }
+ }
+ }
+
+ return big;
+}
+
void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene)
{
int bit;