ScrollView: Don't have drags of the "opposite" orientation cancel clicks.

This commit is contained in:
Henrik Rydgård committed 2026-05-10 23:41:39 +02:00
1 parent 3de6865380
commit 2c0f562ff5
4 files changed
+16 -4

No files matched your search

+9
View File
@@ -12,6 +12,15 @@ namespace UI {
float ScrollView::lastScrollPosX = 0;
float ScrollView::lastScrollPosY = 0;
ScrollView::ScrollView(Orientation orientation, LayoutParams *layoutParams)
: ViewGroup(layoutParams), orientation_(orientation) {
if (orientation == ORIENT_HORIZONTAL) {
gesture_.SetGestureMask(GESTURE_DRAG_HORIZONTAL);
} else {
gesture_.SetGestureMask(GESTURE_DRAG_VERTICAL);
}
}
ScrollView::~ScrollView() {
lastScrollPosX = 0;
lastScrollPosY = 0;