From 82adcce2b7038b54daeff238a3490f8275c3f20a Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Wed, 11 Jun 2008 19:43:36 +0000 Subject: [PATCH] - 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 --- src/kits/interface/View.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 2b977cfa94..1d5561b3a4 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -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)); }