mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-20 08:24:32 +00:00
[ui] Use correct type for expansion calculations
Using unsigned in the calculations makes for some very large views.
This commit is contained in:
parent
08cd03e632
commit
b58c373f3e
1 changed files with 6 additions and 4 deletions
|
@ -478,9 +478,10 @@ calc_expansions (imui_ctx_t *ctx, hierarchy_t *h)
|
|||
len[child].x = len[i].x;
|
||||
// printf ("xc:%d p:%d l:%d\n", child, len[i].x, len[child].x);
|
||||
} else {
|
||||
uint32_t space = len[i].x - tlen.x;
|
||||
int space = len[i].x - tlen.x;
|
||||
int *p = Ent_GetComponent (ent[child], c_percent_x, reg);
|
||||
len[child].x += *p * space / elen.x;
|
||||
int delta = *p * space / elen.x;
|
||||
len[child].x += max (delta, 0);
|
||||
// printf ("xc:%d p:%d s:%d e:%d: l:%d\n", child, *p, space,
|
||||
// elen.x, len[child].x);
|
||||
}
|
||||
|
@ -491,9 +492,10 @@ calc_expansions (imui_ctx_t *ctx, hierarchy_t *h)
|
|||
continue;
|
||||
}
|
||||
if (cont[i].vertical) {
|
||||
uint32_t space = len[i].y - tlen.y;
|
||||
int space = len[i].y - tlen.y;
|
||||
int *p = Ent_GetComponent (ent[child], c_percent_y, reg);
|
||||
len[child].y += *p * space / elen.y;
|
||||
int delta = *p * space / elen.y;
|
||||
len[child].y += max (delta, 0);
|
||||
// printf ("yc:%d p:%d s:%d e:%d: l:%d\n", child, *p, space,
|
||||
// elen.y, len[child].y);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue