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/interface/interface_panel.c | |
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/interface/interface_panel.c')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 20 |
1 files changed, 3 insertions, 17 deletions
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; |