mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 15:28:58 +01:00
BListView: Do not call virtual ScrollTo(BPoint) method in ScrollTo(index).
ScrollTo(index) was introduced only in 82bfaa954d
,
in the implementation of autoscroll-on-drag. But if we call the virtual
methods from here, subclasses might recurse back into us when calling
other methods (MouseMoved() in particular), so in order to avoid
an infinite recursion we have to call ourselves explicitly here.
Fixes a crash on drag in list views in WonderBrush.
Change-Id: Ie7a1bbb75161815bac1f5a800c9ba5830ac43a0f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8014
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
This commit is contained in:
parent
cb92249c88
commit
b3a64f5856
@ -1235,9 +1235,9 @@ BListView::ScrollTo(int32 index)
|
||||
BRect itemFrame = ItemFrame(index);
|
||||
BRect bounds = Bounds();
|
||||
if (itemFrame.top < bounds.top)
|
||||
ScrollTo(itemFrame.LeftTop());
|
||||
BListView::ScrollTo(itemFrame.LeftTop());
|
||||
else if (itemFrame.bottom > bounds.bottom)
|
||||
ScrollTo(BPoint(0, itemFrame.bottom - bounds.Height()));
|
||||
BListView::ScrollTo(BPoint(0, itemFrame.bottom - bounds.Height()));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user