Skip to content

ScrollViewer wheel notch distance and motion differ from WinUI #24733

Closed

Description

@MartinZikmund

Current behavior 🐛

A wheel notch on the legacy ScrollViewer scrolls Max(48, Round(0.15 × viewport)) DIP (the non-DirectManipulation fallback), so viewports under 320 DIP scroll up to 3× too far. Each notch also restarts a 1 s Power(Out, 10) animation, so wheel scrolling is slow to settle (~1 s) and its speed jumps on every notch.

Expected behavior 🎯

Match WinUI 3's ScrollViewer, measured frame by frame: 15% of the viewport × delta/120 per notch with no floor, and a ~220 ms ease-out per notch (about 22% on the first frame, then quadratic), retargeting on each notch: 50% of the distance in ~47 ms, 90% in ~145 ms.

How to reproduce it (as minimally and precisely as possible) 🔬

Scroll a small ScrollViewer (e.g. 100 DIP tall) with a mouse wheel next to WinUI 3.

Workaround 🛠️

None.

Renderer 🎨

  • Skia

Affected platforms 📱💻🖥️

  • WebAssembly
  • Android
  • iOS
  • macOS (AppKit)
  • Windows (Skia)
  • Linux (Skia)

Uno.Sdk version (and other relevant versions) 📦

master (Uno Platform 7.0 dev)

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

Measurement data and fits are attached to the PR.

Activity

  1. added
    kind/bug
    on Sep 25, 2026
  2. MartinZikmund commented on Oct 12, 2026

    @MartinZikmund
    MemberAuthor

    Two more differences in the same helpers, found by comparing GetVerticalScrollWheelDelta / GetHorizontalScrollWheelDelta (ScrollContentPresenter.mux.cs#L24-L27) with WinUI's GetVertical/HorizontalScrollWheelDelta macros (ScrollViewer_Partial.h). Confirmed by code inspection against the WinUI C++ sources, not by a runtime run:

    • Rounding: Uno uses Math.Round(x, 0) (midpoint to even). WinUI's DoubleUtil::Round is Floor(x/scale + 0.5) * scale (midpoint up). E.g. a 350 DIP viewport gives 52.5, which is 53 in WinUI and 52 in Uno.
    • Negative deltas are never clamped to the viewport: WinUI always passes a positive magnitude and applies the sign at the call site (MouseWheelUp/Down), so Min(Floor(size), d) limits both directions. Uno passes the signed delta (-delta, ScrollContentPresenter.cs#L310), so a negative distance bypasses the clamp: a 100 DIP viewport with a +1200 delta scrolls 480 px one way, while the other direction is limited to 100.

    Both go away if the macros are replaced as in #24740 (no rounding, symmetric clamp), so this is just a note for that review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions