Small improvement in efficiency, don't invalidate the
layout when the string width did not change. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38589 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4e57cee58b
commit
38c4dc0eaa
@ -294,10 +294,14 @@ BStringView::SetText(const char* text)
|
||||
if ((text && fText && !strcmp(text, fText)) || (!text && !fText))
|
||||
return;
|
||||
|
||||
float oldWidth = StringWidth(fText);
|
||||
|
||||
free(fText);
|
||||
fText = text ? strdup(text) : NULL;
|
||||
|
||||
InvalidateLayout();
|
||||
if (oldWidth != StringWidth(fText))
|
||||
InvalidateLayout();
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user