Removed duplicated calculation of bounding rect for display name

This commit is contained in:
Jose Carlos 2014-02-21 00:37:29 +01:00
parent 354c9bff09
commit 10c9b902b9

View file

@ -349,12 +349,10 @@ void Avatar::renderDisplayName() {
int text_y = -_displayNameBoundingRect.height() / 2; int text_y = -_displayNameBoundingRect.height() / 2;
// draw a gray background // draw a gray background
QRect rect = textRenderer(DISPLAYNAME)->metrics().tightBoundingRect(_displayName); int left = text_x + _displayNameBoundingRect.x();
int right = left + _displayNameBoundingRect.width();
int left = text_x + rect.x(); int bottom = text_y + _displayNameBoundingRect.y();
int right = left + rect.width(); int top = bottom + _displayNameBoundingRect.height();
int bottom = text_y + rect.y();
int top = bottom + rect.height();
const int border = 8; const int border = 8;
bottom -= border; bottom -= border;
left -= border; left -= border;