Skip to content

Commit

Permalink
Fixed|libgui|Font: Adjusted text rasterizer to avoid clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 22, 2013
1 parent 8df0974 commit 6c734bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doomsday/libgui/src/font.cpp
Expand Up @@ -99,16 +99,16 @@ QImage Font::rasterize(String const &textLine,

Rectanglei bounds = measure(textLine);

QImage img(QSize(bounds.width(), bounds.height()), QImage::Format_ARGB32);
QImage img(QSize(bounds.width(), bounds.height() + 1), QImage::Format_ARGB32);

QColor bgColor(background.x, background.y, background.z, background.w);
img.fill(bgColor.rgba());

QPainter painter(&img);
QPainter painter(&img);
painter.setFont(d->font);
painter.setPen(QColor(foreground.x, foreground.y, foreground.z, foreground.w));
painter.setBrush(bgColor);
painter.drawText(0, d->ascentRule->valuei(), textLine);
painter.drawText(img.rect(), Qt::TextDontClip | Qt::TextSingleLine, textLine);
return img;
}

Expand Down

0 comments on commit 6c734bb

Please sign in to comment.