code cleanup: quiet some -Wshadow warnings, mix of obvious mistakes and harmless global/local naming conflict.

This commit is contained in:
2013-03-15 22:55:10 +00:00
parent 6379dea41c
commit d9c9209608
9 changed files with 27 additions and 30 deletions

View File

@@ -235,14 +235,13 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
BLI_assert(*type == MOUSEPAN);
/* sign differs, reset */
if ((dy > 0 && lastdy < 0) || (dy < 0 && lastdy > 0))
if ((dy > 0 && lastdy < 0) || (dy < 0 && lastdy > 0)) {
lastdy = dy;
}
else {
lastdy += dy;
if (ABS(lastdy) > (int)UI_UNIT_Y) {
int dy = event->prevy - event->y;
if (U.uiflag2 & USER_TRACKPAD_NATURAL)
dy = -dy;
@@ -804,8 +803,6 @@ static void ui_drag_toggle_set(bContext *C, uiDragToggleHandle *drag_info, const
* button we mouse over is X or Y aligned, then lock the mouse to that axis after.
*/
if (drag_info->xy_lock[0] == false && drag_info->xy_lock[1] == false) {
ARegion *ar = CTX_wm_region(C);
/* first store the buttons original coords */
uiBut *but = ui_but_find_mouse_over(ar, xy_input[0], xy_input[1]);
if (but) {

View File

@@ -663,9 +663,9 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
/* since the text has beens caled already, the size of tooltips is defined now */
/* here we try to figure out the right location */
if (butregion) {
float ofsx = rect_fl.xmin, ofsy = rect_fl.ymax;
ui_block_to_window_fl(butregion, but->block, &ofsx, &ofsy);
BLI_rctf_translate(&rect_fl, ofsx - rect_fl.xmin, ofsy - rect_fl.ymax);
float ofsx_fl = rect_fl.xmin, ofsy_fl = rect_fl.ymax;
ui_block_to_window_fl(butregion, but->block, &ofsx_fl, &ofsy_fl);
BLI_rctf_translate(&rect_fl, ofsx_fl - rect_fl.xmin, ofsy_fl - rect_fl.ymax);
}
BLI_rcti_rctf_copy(&rect_i, &rect_fl);