View Issue Details

IDProjectCategoryView StatusLast Update
0002408NoesisGUIC++ SDKpublic2022-09-07 12:06
Reporterdcockerham Assigned Tosfernandez  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.1.5 
Target Version3.1.6Fixed in Version3.1.6 
Summary0002408: ScrollChanged event missing the timing for ongoing scrolling input
DescriptionFor 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 Reproduce1. 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.
TagsC++, scroll
PlatformAny

Activities

sfernandez

sfernandez

2022-09-07 12:06

manager   ~0008055

Fixed with changes in revisions 11589 and 11590.

Issue History

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