* Round mouse coords before doing BRegion ops for the transparent

selection rect, as BRegion behaves unpredictably with non-integral 
values (cf bebook).
  Fixes #1527


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29316 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2009-02-24 18:55:23 +00:00
parent 5abd9a464d
commit ea83c971c6

View File

@ -6735,11 +6735,17 @@ BPoseView::DragSelectionRect(BPoint startPoint, bool shouldExtend)
return;
}
// BRegion doesn't like non-integral values, see below
startPoint.x = roundf(startPoint.x);
startPoint.y = roundf(startPoint.y);
// clearing the selection could take a while so poll the mouse again
BPoint newMousePoint;
uint32 button;
GetMouse(&newMousePoint, &button);
newMousePoint.x = roundf(newMousePoint.x);
newMousePoint.y = roundf(newMousePoint.y);
// draw initial empty selection rectangle
BRect lastSelectionRect;
fSelectionRect = lastSelectionRect = BRect(startPoint, startPoint - BPoint(1, 1));
@ -6755,6 +6761,9 @@ BPoseView::DragSelectionRect(BPoint startPoint, bool shouldExtend)
BPoint oldMousePoint(startPoint);
while (button) {
GetMouse(&newMousePoint, &button, false);
newMousePoint.x = roundf(newMousePoint.x);
newMousePoint.y = roundf(newMousePoint.y);
if (newMousePoint != oldMousePoint) {
oldMousePoint = newMousePoint;
BRect oldRect = fSelectionRect;