Skip to content

Commit

Permalink
Fix warning about using abs() with floats (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
bostick authored and zturtleman committed Jul 9, 2017
1 parent 7c25206 commit a33a904
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/ui/ui_shared.c
Expand Up @@ -1121,10 +1121,10 @@ void Menu_TransitionItemByName(menuDef_t *menu, const char *p, rectDef_t rectFro
item->window.offsetTime = time;
memcpy(&item->window.rectClient, &rectFrom, sizeof(rectDef_t));
memcpy(&item->window.rectEffects, &rectTo, sizeof(rectDef_t));
item->window.rectEffects2.x = abs(rectTo.x - rectFrom.x) / amt;
item->window.rectEffects2.y = abs(rectTo.y - rectFrom.y) / amt;
item->window.rectEffects2.w = abs(rectTo.w - rectFrom.w) / amt;
item->window.rectEffects2.h = abs(rectTo.h - rectFrom.h) / amt;
item->window.rectEffects2.x = fabs(rectTo.x - rectFrom.x) / amt;
item->window.rectEffects2.y = fabs(rectTo.y - rectFrom.y) / amt;
item->window.rectEffects2.w = fabs(rectTo.w - rectFrom.w) / amt;
item->window.rectEffects2.h = fabs(rectTo.h - rectFrom.h) / amt;
Item_UpdatePosition(item);
}
}
Expand Down

0 comments on commit a33a904

Please sign in to comment.