Removed SourceView::_VisibleRect() as it was functionally identical to BView::Bounds(). Implemented variable-speed drag scrolling.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31612 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1327,7 +1327,14 @@ SourceView::TextView::_HandleAutoScroll(void)
|
|||||||
// (returning the entire view rect) is correct, and if not, fix
|
// (returning the entire view rect) is correct, and if not, fix
|
||||||
// and remove the workaround here of asking the parent bounds to do the
|
// and remove the workaround here of asking the parent bounds to do the
|
||||||
// comparison
|
// comparison
|
||||||
_ScrollByLines(point.y < fSourceView->Bounds().top ? -1 : 1);
|
float difference = 0.0;
|
||||||
|
BRect sourceBounds = fSourceView->Bounds();
|
||||||
|
if (point.y < sourceBounds.top)
|
||||||
|
difference = point.y - sourceBounds.top;
|
||||||
|
else
|
||||||
|
difference = point.y - sourceBounds.bottom;
|
||||||
|
int factor = (int)(difference / fFontInfo->lineHeight);
|
||||||
|
_ScrollByLines(factor);
|
||||||
MouseMoved(point, B_OUTSIDE_VIEW, NULL);
|
MouseMoved(point, B_OUTSIDE_VIEW, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1543,7 +1550,7 @@ printf("SourceView::ScrollToLine(%lu)\n", line);
|
|||||||
float top = (float)line * fFontInfo.lineHeight;
|
float top = (float)line * fFontInfo.lineHeight;
|
||||||
float bottom = top + fFontInfo.lineHeight - 1;
|
float bottom = top + fFontInfo.lineHeight - 1;
|
||||||
|
|
||||||
BRect visible = _VisibleRect();
|
BRect visible = Bounds();
|
||||||
printf("SourceView::ScrollToLine(%ld)\n", line);
|
printf("SourceView::ScrollToLine(%ld)\n", line);
|
||||||
printf(" visible: (%f, %f) - (%f, %f), line: %f - %f\n", visible.left, visible.top, visible.right, visible.bottom, top, bottom);
|
printf(" visible: (%f, %f) - (%f, %f), line: %f - %f\n", visible.left, visible.top, visible.right, visible.bottom, top, bottom);
|
||||||
|
|
||||||
@@ -1683,13 +1690,6 @@ SourceView::_DataRectSize() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
|
||||||
SourceView::_VisibleRect() const
|
|
||||||
{
|
|
||||||
return BRect(Bounds().LeftTop(), Frame().Size());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - Listener
|
// #pragma mark - Listener
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ private:
|
|||||||
void _Init();
|
void _Init();
|
||||||
void _UpdateScrollBars();
|
void _UpdateScrollBars();
|
||||||
BSize _DataRectSize() const;
|
BSize _DataRectSize() const;
|
||||||
BRect _VisibleRect() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TeamDebugModel* fDebugModel;
|
TeamDebugModel* fDebugModel;
|
||||||
|
|||||||
Reference in New Issue
Block a user