Ooops, fix the binary compatibility I introduced.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38592 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -78,11 +78,9 @@ private:
|
||||
|
||||
private:
|
||||
char* fText;
|
||||
float fTextWidth;
|
||||
float fStringWidth;
|
||||
alignment fAlign;
|
||||
BSize fPreferredSize;
|
||||
|
||||
uint32 _reserved[1];
|
||||
};
|
||||
|
||||
#endif // _STRING_VIEW_H
|
||||
|
||||
@@ -29,7 +29,7 @@ BStringView::BStringView(BRect frame, const char* name, const char* text,
|
||||
uint32 resizeMask, uint32 flags)
|
||||
: BView(frame, name, resizeMask, flags | B_FULL_UPDATE_ON_RESIZE),
|
||||
fText(text ? strdup(text) : NULL),
|
||||
fTextWidth(text ? StringWidth(text) : 0.0),
|
||||
fStringWidth(text ? StringWidth(text) : 0.0),
|
||||
fAlign(B_ALIGN_LEFT),
|
||||
fPreferredSize(-1, -1)
|
||||
{
|
||||
@@ -39,7 +39,7 @@ BStringView::BStringView(BRect frame, const char* name, const char* text,
|
||||
BStringView::BStringView(const char* name, const char* text, uint32 flags)
|
||||
: BView(name, flags | B_FULL_UPDATE_ON_RESIZE),
|
||||
fText(text ? strdup(text) : NULL),
|
||||
fTextWidth(text ? StringWidth(text) : 0.0),
|
||||
fStringWidth(text ? StringWidth(text) : 0.0),
|
||||
fAlign(B_ALIGN_LEFT),
|
||||
fPreferredSize(-1, -1)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ BStringView::BStringView(const char* name, const char* text, uint32 flags)
|
||||
BStringView::BStringView(BMessage* data)
|
||||
: BView(data),
|
||||
fText(NULL),
|
||||
fTextWidth(0.0),
|
||||
fStringWidth(0.0),
|
||||
fPreferredSize(-1, -1)
|
||||
{
|
||||
int32 align;
|
||||
@@ -244,11 +244,11 @@ BStringView::Draw(BRect updateRect)
|
||||
float x;
|
||||
switch (fAlign) {
|
||||
case B_ALIGN_RIGHT:
|
||||
x = bounds.Width() - fTextWidth;
|
||||
x = bounds.Width() - fStringWidth;
|
||||
break;
|
||||
|
||||
case B_ALIGN_CENTER:
|
||||
x = (bounds.Width() - fTextWidth) / 2.0;
|
||||
x = (bounds.Width() - fStringWidth) / 2.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -300,9 +300,9 @@ BStringView::SetText(const char* text)
|
||||
free(fText);
|
||||
fText = text ? strdup(text) : NULL;
|
||||
|
||||
float newTextWidth = StringWidth(fText);
|
||||
if (fTextWidth != newTextWidth) {
|
||||
fTextWidth = newTextWidth;
|
||||
float newStringWidth = StringWidth(fText);
|
||||
if (fStringWidth != newStringWidth) {
|
||||
fStringWidth = newStringWidth;
|
||||
InvalidateLayout();
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ BStringView::SetFont(const BFont* font, uint32 mask)
|
||||
{
|
||||
BView::SetFont(font, mask);
|
||||
|
||||
fTextWidth = StringWidth(fText);
|
||||
fStringWidth = StringWidth(fText);
|
||||
|
||||
Invalidate();
|
||||
InvalidateLayout();
|
||||
@@ -440,7 +440,7 @@ BStringView::_ValidatePreferredSize()
|
||||
{
|
||||
if (fPreferredSize.width < 0) {
|
||||
// width
|
||||
fPreferredSize.width = ceilf(fTextWidth);
|
||||
fPreferredSize.width = ceilf(fStringWidth);
|
||||
|
||||
// height
|
||||
font_height fontHeight;
|
||||
|
||||
Reference in New Issue
Block a user