* Replaced direct Draw() calls with calls to Invalidate().
* Some more cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17712 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -682,7 +682,7 @@ TWindow::InfoIsShowing()
|
|||||||
void
|
void
|
||||||
TWindow::UpdateInfo()
|
TWindow::UpdateInfo()
|
||||||
{
|
{
|
||||||
fInfo->Draw(fInfo->Bounds());
|
fInfo->Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -869,10 +869,12 @@ TInfoView::TInfoView(BRect frame)
|
|||||||
fCH2Str[0] = 0;
|
fCH2Str[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TInfoView::~TInfoView()
|
TInfoView::~TInfoView()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TInfoView::AttachedToWindow()
|
TInfoView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
@@ -884,13 +886,11 @@ TInfoView::AttachedToWindow()
|
|||||||
AddMenu();
|
AddMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TInfoView::Draw(BRect updateRect)
|
TInfoView::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
PushState();
|
PushState();
|
||||||
|
|
||||||
char str[64];
|
|
||||||
|
|
||||||
SetLowColor(ViewColor());
|
SetLowColor(ViewColor());
|
||||||
|
|
||||||
BRect invalRect;
|
BRect invalRect;
|
||||||
@@ -900,6 +900,8 @@ TInfoView::Draw(BRect updateRect)
|
|||||||
int32 pixelSize = dynamic_cast<TWindow*>(Window())->PixelSize();
|
int32 pixelSize = dynamic_cast<TWindow*>(Window())->PixelSize();
|
||||||
|
|
||||||
MovePenTo(10, fFontHeight + 5);
|
MovePenTo(10, fFontHeight + 5);
|
||||||
|
|
||||||
|
char str[64];
|
||||||
sprintf(str, "%li x %li @ %li pixels/pixel", hPixelCount, vPixelCount,
|
sprintf(str, "%li x %li @ %li pixels/pixel", hPixelCount, vPixelCount,
|
||||||
pixelSize);
|
pixelSize);
|
||||||
invalRect.Set(10, 5, 10 + StringWidth(fInfoStr), fFontHeight+7);
|
invalRect.Set(10, 5, 10 + StringWidth(fInfoStr), fFontHeight+7);
|
||||||
@@ -1158,7 +1160,7 @@ TMagnify::KeyDown(const char *key, int32 numBytes)
|
|||||||
fSelection = 0;
|
fSelection = 0;
|
||||||
}
|
}
|
||||||
fNeedToUpdate = true;
|
fNeedToUpdate = true;
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1269,7 +1271,7 @@ TMagnify::MouseDown(BPoint where)
|
|||||||
// update the info region
|
// update the info region
|
||||||
|
|
||||||
fNeedToUpdate = true;
|
fNeedToUpdate = true;
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1291,7 +1293,7 @@ TMagnify::SetSelection(bool state)
|
|||||||
|
|
||||||
fShowSelection = state;
|
fShowSelection = state;
|
||||||
fSelection = 0;
|
fSelection = 0;
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1326,7 +1328,7 @@ TMagnify::MoveSelection(int32 x, int32 y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fNeedToUpdate = true;
|
fNeedToUpdate = true;
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1355,7 +1357,7 @@ TMagnify::MoveSelectionTo(int32 x, int32 y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fNeedToUpdate = true;
|
fNeedToUpdate = true;
|
||||||
Draw(Bounds());
|
Invalidate(); //Draw(Bounds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1488,9 +1490,9 @@ TMagnify::Update(bool force)
|
|||||||
GetMouse(&loc, &button);
|
GetMouse(&loc, &button);
|
||||||
|
|
||||||
ConvertToScreen(&loc);
|
ConvertToScreen(&loc);
|
||||||
if (force || (fLastLoc != loc) || (counter++ % 35 == 0)) {
|
if (force || fLastLoc != loc || counter++ % 35 == 0) {
|
||||||
if (fImageView->CreateImage(loc, force))
|
if (fImageView->CreateImage(loc, force))
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
|
|
||||||
counter = 0;
|
counter = 0;
|
||||||
if (force)
|
if (force)
|
||||||
@@ -1568,7 +1570,7 @@ TMagnify::AddCrossHair()
|
|||||||
if (fCrossHair1.y >= h)
|
if (fCrossHair1.y >= h)
|
||||||
fCrossHair1.y = 0;
|
fCrossHair1.y = 0;
|
||||||
}
|
}
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1585,7 +1587,7 @@ TMagnify::RemoveCrossHair()
|
|||||||
fSelection = 0;
|
fSelection = 0;
|
||||||
fShowCrossHair1 = false;
|
fShowCrossHair1 = false;
|
||||||
}
|
}
|
||||||
Draw(Bounds());
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user