- BView::MoveBy was letting BView::MoveTo do the rounding after adding

the delta.
  For example, MoveBy(-0.5, 0.0) would do nothing in this case: 
roundf(150.0 - 0.5) = 150.0, when rounding the delta it gives the 
expected value: roundf(150.0 + roundf(-0.5)) = 149. 

  On the other hand, BView::ResizeBy was doing it right, and this 
explains the bug in Cortex (#333). Cortex was doing 
scrollBar->MoveBy(-0.5,0) then scrollBar->ResizeBy(0.5,0) and the 
inconsistency lead to the visual bug. (see StatusView::MouseMoved())

  This fixes #333. The bug was strange to reproduce since sometimes the 
point received in MouseMoved would be "some_integer+0.5" values 
sometimes just integral. This has still to be investigated though not 
problematic here anymore. See cortex/RouteApp/StatusView.cpp line 222.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25930 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner
2008-06-11 19:43:36 +00:00
parent 730ebb158c
commit 82adcce2b7
+1 -1
View File
@@ -3617,7 +3617,7 @@ BView::FindView(const char *name) const
void
BView::MoveBy(float deltaX, float deltaY)
{
MoveTo(fParentOffset.x + deltaX, fParentOffset.y + deltaY);
MoveTo(fParentOffset.x + roundf(deltaX), fParentOffset.y + roundf(deltaY));
}