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-05-20 09:27:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-20 09:27:31 +0400
commit170716ca533b250ffa9ae031096bbef9ad7c2976 (patch)
tree3c20404f22073aab79dc6ff5e9e08cd2f841d951 /source/blender/editors/interface/view2d.c
parent984d2e42e4a81c1f92dc405ce1b265842bc94b9a (diff)
use BKE_area_find_region_type in place of inline loops (no functional changes).
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 84cf5af5414..eb522a1d2b8 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -44,6 +44,7 @@
#include "BLI_utildefines.h"
#include "BKE_context.h"
+#include "BKE_screen.h"
#include "BKE_global.h"
@@ -1959,17 +1960,14 @@ View2D *UI_view2d_fromcontext(const bContext *C)
/* same as above, but it returns regionwindow. Utility for pulldowns or buttons */
View2D *UI_view2d_fromcontext_rwin(const bContext *C)
{
- ScrArea *area= CTX_wm_area(C);
+ ScrArea *sa= CTX_wm_area(C);
ARegion *region= CTX_wm_region(C);
- if (area == NULL) return NULL;
+ if (sa == NULL) return NULL;
if (region == NULL) return NULL;
if (region->regiontype!=RGN_TYPE_WINDOW) {
- ARegion *ar= area->regionbase.first;
- for(; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_WINDOW)
- return &(ar->v2d);
- return NULL;
+ ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
+ return ar ? &(ar->v2d) : NULL;
}
return &(region->v2d);
}