View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002408 | NoesisGUI | C++ SDK | public | 2022-09-02 23:23 | 2022-09-07 12:06 |
Reporter | dcockerham | Assigned To | sfernandez | ||
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Product Version | 3.1.5 | ||||
Target Version | 3.1.6 | Fixed in Version | 3.1.6 | ||
Summary | 0002408: ScrollChanged event missing the timing for ongoing scrolling input | ||||
Description | For a custom ScrollViewer with that modifies the scroll position in response to a ScrollChanged event (such as to create an AcceleratedScrollViewer that increases scroll speed over time), the modified scroll position is immediately overwritten by OnMouseWheelExternal() for as long as the scrolling continues. The modified scroll is only applied on the last frame when the scrolling stops, as there is no longer an overwriting OnMouseWheelExternal() call. This seems to be a timing issue stemming from a recent change to ScrollViewer. Here is a sample of the two functions in question that demonstrates the issue: FastScrollViewer::FastScrollViewer() { this->ScrollChanged() += [this](BaseComponent* /* sender */, const ScrollChangedEventArgs& args) { const float delta = abs(args.verticalChange); if (delta > ACCELERATED_SCROLL_INCREMENT_BASE) { // filter out returning accelerated scroll increments, as in: calling ScrollToVerticalOffset will call ScrollChanged again return; } ScrollToVerticalOffset(GetVerticalOffset() + (float)sgn(args.verticalChange) * delta * 1000); }; } void FastScrollViewer::OnMouseWheelExternal(float wheelRotation, Noesis::Orientation orientation) { if (orientation == Noesis::Orientation::Orientation_Vertical) { ScrollToVerticalOffset(GetVerticalOffset() - wheelRotation / 3.0f); } } | ||||
Steps To Reproduce | 1. Create a child class inheriting from ScrollViewer that calls ScrollToVerticalOffset() in OnMouseWheelExternal(), and calls OnMouseWheelExternal() with increased multiplier in response to a ScrollChanged event. 2. Scroll over time by holding a controller's right joystick down. 3. Observe that the ScrollViewer moves at the normal pace instead of the boosted pace, and the scrolling may seem jittery as it jumps between the modified and unmodified values, with the scrollbar matching the unmodified position. Releasing the right joystick results in finally jumping to/settling on the modified position. | ||||
Tags | C++, scroll | ||||
Platform | Any | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2022-09-02 23:23 | dcockerham | New Issue | |
2022-09-02 23:23 | dcockerham | Tag Attached: C++ | |
2022-09-02 23:23 | dcockerham | Tag Attached: scroll | |
2022-09-05 11:56 | sfernandez | Assigned To | => sfernandez |
2022-09-05 11:56 | sfernandez | Status | new => assigned |
2022-09-05 11:56 | sfernandez | Target Version | => 3.1.6 |
2022-09-07 12:06 | sfernandez | Status | assigned => resolved |
2022-09-07 12:06 | sfernandez | Resolution | open => fixed |
2022-09-07 12:06 | sfernandez | Fixed in Version | => 3.1.6 |
2022-09-07 12:06 | sfernandez | Note Added: 0008055 |