From 10c9b902b9fd2b5e36972fe90083b46f9650ef95 Mon Sep 17 00:00:00 2001 From: Jose Carlos Date: Fri, 21 Feb 2014 00:37:29 +0100 Subject: [PATCH] Removed duplicated calculation of bounding rect for display name --- interface/src/avatar/Avatar.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 54a0dc5654..dcecd0258d 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -349,12 +349,10 @@ void Avatar::renderDisplayName() { int text_y = -_displayNameBoundingRect.height() / 2; // draw a gray background - QRect rect = textRenderer(DISPLAYNAME)->metrics().tightBoundingRect(_displayName); - - int left = text_x + rect.x(); - int right = left + rect.width(); - int bottom = text_y + rect.y(); - int top = bottom + rect.height(); + int left = text_x + _displayNameBoundingRect.x(); + int right = left + _displayNameBoundingRect.width(); + int bottom = text_y + _displayNameBoundingRect.y(); + int top = bottom + _displayNameBoundingRect.height(); const int border = 8; bottom -= border; left -= border;