From f91187d3c3b58c07059678968085f9ca0eb9908f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 3 Dec 2013 23:53:21 +1100 Subject: Code cleanup: replace rectf_scale with BLI_rctf_scale and add area arg to ui_handler_panel_region --- source/blender/editors/interface/interface_panel.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'source/blender/editors/interface/interface_panel.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; -- cgit v1.2.3