-
Notifications
You must be signed in to change notification settings - Fork 6k
Conversation
d985f0e
to
5c95e94
Compare
@@ -53,16 +56,31 @@ HRESULT DirectManipulationEventHandler::OnViewportStatusChanged( | |||
(int32_t) reinterpret_cast<int64_t>(this)); | |||
} | |||
} | |||
} else if (previous == DIRECTMANIPULATION_RUNNING) { | |||
} | |||
if (previous == DIRECTMANIPULATION_RUNNING) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we combine the previous if
clause and this one into
if (previous == DIRECTMANIPULATION_RUNNING) { | |
if (previous == DIRECTMANIPULATION_RUNNING) { | |
if (during_synthesized_reset_) { | |
during_synthesized_reset_ = false; | |
} else if (current == DIRECTMANIPULATION_RUNNING) { | |
... | |
} | |
// Reset deltas to ensure only inertia values will be compared later. | |
... |
(Did I suggest the current way when I first reviewed this file? Sorry if I did.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do that since the else if
would no longer make any sense (previous and current state will not ever be the same).
if (owner_->binding_handler_delegate) { | ||
owner_->binding_handler_delegate->OnPointerPanZoomEnd( | ||
(int32_t) reinterpret_cast<int64_t>(this)); | ||
} | ||
} else if (previous == DIRECTMANIPULATION_INERTIA) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only compare the previous status but not the current, does it mean if the inertia movement dies out naturally it will also dispatch a cancel event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current should always be DIRECTMANIPULATION_READY whether it dies out naturally or is cancelled. We can only tell if it's cancelled prematurely by seeing if the last event still had meaningful velocity left (hadn't already decelerated to near-zero).
5c95e94
to
f439be2
Compare
May we show some love to this one? I don't know how to explain it, but when I scroll on Windows with my trackpad (post Flutter 3.3.x), it feels sort of "un-natural". Scrolling abruptly stops or starts scrolling in completely opposite direction when making a swipe on my trackpad while a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Generate PointerScrollInertiaCancel event on Win32 when DirectManipulation inertia is prematurely ended. This should correspond to a trackpad touch.
Part of flutter/flutter#106979
Pre-launch Checklist
writing and running engine tests.
///
).