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:
Diffstat (limited to 'source/blender/editors/space_image/space_image.c')
-rw-r--r--source/blender/editors/space_image/space_image.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 409ab4b2fc6..2e9544f5d20 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -328,16 +328,13 @@ static void image_scopes_tag_refresh(ScrArea *sa)
ARegion *image_has_buttons_region(ScrArea *sa)
{
ARegion *ar, *arnew;
-
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_UI)
- return ar;
+
+ ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
+ if(ar) return ar;
/* add subdiv level; after header */
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_HEADER)
- break;
-
+ ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
+
/* is error! */
if(ar==NULL) return NULL;
@@ -355,16 +352,13 @@ ARegion *image_has_buttons_region(ScrArea *sa)
ARegion *image_has_scope_region(ScrArea *sa)
{
ARegion *ar, *arnew;
-
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_PREVIEW)
- return ar;
-
+
+ ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
+ if(ar) return ar;
+
/* add subdiv level; after buttons */
- for(ar= sa->regionbase.first; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_UI)
- break;
-
+ ar= BKE_area_find_region_type(sa, RGN_TYPE_UI);
+
/* is error! */
if(ar==NULL) return NULL;