diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-07-29 10:32:30 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-07-29 10:32:30 +0400 |
commit | b46d8955509e805f06b76a6fd800ecb4edee113b (patch) | |
tree | 7ed0b1a3b5d04ab48d3e9062ff02ce54961ecb06 /source/blender/editors/interface/view2d.c | |
parent | 6960127d2609620d52620539388ada5cb466bab2 (diff) | |
parent | 26589497529ca3c8da85391d4976d286a371e258 (diff) |
Merging r36529-38806bge_components
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r-- | source/blender/editors/interface/view2d.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 32301dd6423..43bf2f59e04 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" @@ -1541,7 +1542,7 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power } /* draw it */ - BLF_draw_default(x, y, 0.0f, str, sizeof(str)-1); + BLF_draw_default_ascii(x, y, 0.0f, str, sizeof(str)-1); } /* Draw scrollbars in the given 2d-region */ @@ -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); } @@ -2028,7 +2026,7 @@ typedef struct View2DString { unsigned char ub[4]; int pack; } col; - short mval[2]; + int mval[2]; rcti rect; } View2DString; |