Example #1
0
void UIChat_UpdateGeometry(uiwidget_t* obj)
{
    const char* text = UIChat_Text(obj);
    assert(obj->type == GUI_CHAT);

    Rect_SetWidthHeight(obj->geometry, 0, 0);

    if(!UIChat_IsActive(obj)) return;

    FR_SetFont(obj->font);
    Rect_SetWidthHeight(obj->geometry, cfg.msgScale * (FR_TextWidth(text) + FR_CharWidth('_')),
                                       cfg.msgScale * (MAX_OF(FR_TextHeight(text), FR_CharHeight('_'))));
}
Example #2
0
Rect *Rect_NewWithOriginSize2(int x, int y, int width, int height)
{
    Rect *r = Rect_New();
    Rect_SetXY(r, x, y);
    Rect_SetWidthHeight(r, width, height);
    return r;
}
Example #3
0
/// @pre  This and @a other have been normalized.
static Rect *Rect_UniteRaw2(Rect *r, RectRaw const *other)
{
    Point2Raw oldOrigin;
    DENG_ASSERT(r && other);

    Point2_Raw(r->origin, &oldOrigin);

    Rect_SetXY(r, MIN_OF(Point2_X(r->origin), other->origin.x),
                  MIN_OF(Point2_Y(r->origin), other->origin.y));

    Rect_SetWidthHeight(r, MAX_OF(oldOrigin.x + Size2_Width(r->size),
                                  other->origin.x + other->size.width)  - Point2_X(r->origin),
                           MAX_OF(oldOrigin.y + Size2_Height(r->size),
                                  other->origin.y + other->size.height) - Point2_Y(r->origin));

    return r;
}