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:
@@ -294,10 +294,14 @@ BStringView::SetText(const char* text)
|
|||||||
if ((text && fText && !strcmp(text, fText)) || (!text && !fText))
|
if ((text && fText && !strcmp(text, fText)) || (!text && !fText))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
float oldWidth = StringWidth(fText);
|
||||||
|
|
||||||
free(fText);
|
free(fText);
|
||||||
fText = text ? strdup(text) : NULL;
|
fText = text ? strdup(text) : NULL;
|
||||||
|
|
||||||
InvalidateLayout();
|
if (oldWidth != StringWidth(fText))
|
||||||
|
InvalidateLayout();
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user