Skip to content

Commit

Permalink
libcommon|HUD|Fixed: Font renderer attribute state mismanagement
Browse files Browse the repository at this point in the history
Manifested the symptom of Heretic's player message log being drawn
with the tracking property set according to that of the previously
drawn HUD widget.
  • Loading branch information
danij-deng committed Feb 13, 2012
1 parent f647413 commit b162493
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion doomsday/plugins/common/src/hu_lib.c
Expand Up @@ -464,15 +464,18 @@ static void drawWidget2(uiwidget_t* obj, const Point2Raw* offset)
Point2_Raw(Rect_Origin(obj->geometry), &origin);

// Configure the page render state.
/// \todo Initial font renderer setup.
uiRS.pageAlpha = obj->opacity;

FR_PushAttrib();

DGL_MatrixMode(DGL_MODELVIEW);
DGL_Translatef(origin.x, origin.y, 0);

// Do not pass a zero length offset.
obj->drawer(obj, ((offset && (offset->x || offset->y))? offset : NULL));

FR_PopAttrib();

DGL_MatrixMode(DGL_MODELVIEW);
DGL_Translatef(-origin.x, -origin.y, 0);
}
Expand Down Expand Up @@ -526,6 +529,13 @@ void GUI_DrawWidget(uiwidget_t* obj, const Point2Raw* offset)

updateWidgetGeometry(obj);

FR_PopAttrib();

// Draw.
FR_PushAttrib();
FR_LoadDefaultAttrib();
FR_SetLeading(0);

// Do not pass a zero length offset.
drawWidget(obj, ((offset && (offset->x || offset->y))? offset : NULL));

Expand Down

0 comments on commit b162493

Please sign in to comment.