Code cleanup: remove unused button aspect

This commit is contained in:
Campbell Barton 2014-02-13 09:24:48 +11:00
parent e43c3ad88a
commit d4c87f2f79
6 changed files with 9 additions and 12 deletions

View File

@ -2907,7 +2907,6 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
but->lockstr = block->lockstr;
but->dt = block->dt;
but->aspect = 1.0f; /* XXX block->aspect; */
but->block = block; /* pointer back, used for frontbuffer status, and picker */
if ((block->flag & UI_BUT_ALIGN) && ui_but_can_align(but))

View File

@ -1195,10 +1195,10 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
BLI_rcti_size_y(&scissor_new));
/* calculate offset and zoom */
zoomx = (BLI_rcti_size_x(rect) - 2.0f * but->aspect) / BLI_rctf_size_x(&cumap->curr);
zoomy = (BLI_rcti_size_y(rect) - 2.0f * but->aspect) / BLI_rctf_size_y(&cumap->curr);
offsx = cumap->curr.xmin - but->aspect / zoomx;
offsy = cumap->curr.ymin - but->aspect / zoomy;
zoomx = (BLI_rcti_size_x(rect) - 2.0f) / BLI_rctf_size_x(&cumap->curr);
zoomy = (BLI_rcti_size_y(rect) - 2.0f) / BLI_rctf_size_y(&cumap->curr);
offsx = cumap->curr.xmin - (1.0f / zoomx);
offsy = cumap->curr.ymin - (1.0f / zoomy);
/* backdrop */
if (but->a1 == UI_GRAD_H) {

View File

@ -3594,7 +3594,7 @@ static bool ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data,
ui_mouse_scale_warp(data, mx, mx, &mx_fl, &my_fl, shift);
if (but->type == NUMSLI) {
offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
offs = (BLI_rctf_size_y(&but->rect) / 2.0f);
deler = BLI_rctf_size_x(&but->rect) - offs;
}
else if (but->type == SCROLL) {
@ -3603,7 +3603,7 @@ static bool ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data,
offs = 0.0;
}
else {
offs = (BLI_rctf_size_y(&but->rect) / 2.0f) * but->aspect;
offs = (BLI_rctf_size_y(&but->rect) / 2.0f);
deler = (BLI_rctf_size_x(&but->rect) - offs);
}
@ -3616,11 +3616,11 @@ static bool ui_numedit_but_SLI(uiBut *but, uiHandleButtonData *data,
if (ui_is_a_warp_but(but)) {
/* OK but can go outside bounds */
if (is_horizontal) {
data->ungrab_mval[0] = (but->rect.xmin + offs / but->aspect) + (f * deler);
data->ungrab_mval[0] = (but->rect.xmin + offs) + (f * deler);
data->ungrab_mval[1] = BLI_rctf_cent_y(&but->rect);
}
else {
data->ungrab_mval[1] = (but->rect.ymin + offs / but->aspect) + (f * deler);
data->ungrab_mval[1] = (but->rect.ymin + offs) + (f * deler);
data->ungrab_mval[0] = BLI_rctf_cent_x(&but->rect);
}
BLI_rctf_clamp_pt_v(&but->rect, data->ungrab_mval);

View File

@ -196,7 +196,6 @@ struct uiBut {
*/
float a2;
float aspect;
unsigned char col[4];
uiButHandleFunc func;

View File

@ -1379,7 +1379,6 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but,
BLI_rctf_translate(&bt->rect, xof, yof);
bt->aspect = 1.0f;
/* ui_check_but recalculates drawstring size in pixels */
ui_check_but(bt);
}

View File

@ -1254,7 +1254,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
pos = but->pos;
if (pos >= but->ofs) {
if (drawstr[0] != 0) {
t = BLF_width(fstyle->uifont_id, drawstr + but->ofs, pos - but->ofs) / but->aspect;
t = BLF_width(fstyle->uifont_id, drawstr + but->ofs, pos - but->ofs);
}
glColor3f(0.20, 0.6, 0.9);