diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-03 16:53:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-03 16:53:21 +0400 |
commit | f91187d3c3b58c07059678968085f9ca0eb9908f (patch) | |
tree | 269116658f59f5175632a538de5bfeb91c8972a3 /source/blender/editors | |
parent | 35d89825c16b320f23afbb5048e7212569057a91 (diff) |
Code cleanup: replace rectf_scale with BLI_rctf_scale
and add area arg to ui_handler_panel_region
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 20 |
3 files changed, 5 insertions, 19 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index f903d0647b3..e5140152847 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7851,7 +7851,7 @@ static int ui_handler_region(bContext *C, const wmEvent *event, void *UNUSED(use /* either handle events for already activated button or try to activate */ but = ui_but_find_activated(ar); - retval = ui_handler_panel_region(C, event); + retval = ui_handler_panel_region(C, event, ar); if (retval == WM_UI_HANDLER_CONTINUE) retval = ui_handle_list_event(C, event, ar); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index a12c4a3ff6a..7315da7630f 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -501,7 +501,7 @@ int ui_step_name_menu(uiBut *but, int step); struct AutoComplete; /* interface_panel.c */ -extern int ui_handler_panel_region(struct bContext *C, const struct wmEvent *event); +extern int ui_handler_panel_region(struct bContext *C, const struct wmEvent *event, struct ARegion *ar); extern void ui_draw_aligned_panel(struct uiStyle *style, uiBlock *block, rcti *rect); /* interface_draw.c */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 3fe11ad3a6b..30ee9d29407 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -496,19 +496,6 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r } } -static void rectf_scale(rctf *rect, const float scale) -{ - float centx = BLI_rctf_cent_x(rect); - float centy = BLI_rctf_cent_y(rect); - float sizex = BLI_rctf_size_x(rect) * 0.5f * scale; - float sizey = BLI_rctf_size_y(rect) * 0.5f * scale; - - rect->xmin = centx - sizex; - rect->xmax = centx + sizex; - rect->ymin = centy - sizey; - rect->ymax = centy + sizey; -} - /* panel integrated in buttonswindow, tool/property lists etc */ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) { @@ -565,7 +552,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) itemrect.ymin = headrect.ymin; itemrect.ymax = headrect.ymax; - rectf_scale(&itemrect, 0.7f); + BLI_rctf_scale(&itemrect, 0.7f); ui_draw_panel_dragwidget(&itemrect); } @@ -619,7 +606,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) itemrect.ymin = headrect.ymin; itemrect.ymax = headrect.ymax; - rectf_scale(&itemrect, 0.35f); + BLI_rctf_scale(&itemrect, 0.35f); if (panel->flag & PNL_CLOSEDY) ui_draw_tria_rect(&itemrect, 'h'); @@ -1133,9 +1120,8 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in /* XXX should become modal keymap */ /* AKey is opening/closing panels, independent of button state now */ -int ui_handler_panel_region(bContext *C, const wmEvent *event) +int ui_handler_panel_region(bContext *C, const wmEvent *event, ARegion *ar) { - ARegion *ar = CTX_wm_region(C); uiBlock *block; Panel *pa; int retval, mx, my; |