Skip to content

GetIntermediatePoints for Mouse are not in order/produce junk #20061

@flabbet

Description

@flabbet

Describe the bug

When trying to draw precise brush strokes GetIntermediatePoints is required, otherwise sampling rate is too low.

This works great with digital pen, Intermediate Points are drawn correctly and lines are smooth

2025-11-14.17-49-05.mp4

But, with mouse, intermediate points are either not in order or junk is produced. You can see this when you move the mouse fast and draw a curve. Then algorithm connecting previous and next point with a line clearly connects some old point to the next.

2025-11-14.17-49-49.mp4
Image

This is not an issue with PointerCanvas itself, it's deep within GetIntermediatePoints as I was able to fully reproduce the same effect in my own drawing pipeline

To Reproduce

  1. Open ControlCatalog on Pointers page and select Pressure tab.
  2. Make a fast, curved stroke with a mouse
  3. Observe lines going outside the stroke

Expected behavior

I expect GetIntermediatePoints to provide points in timestamp order, so connecting last point to the next will produce continous stroke.

I suspect it might be driver/mouse/OS dependent. Adding Timestamp to each PointerPoint would be already enough, as user can sort it themselves. Ideally it already should be sorted on Avalonia side if the bug cannot be solved differently.

Avalonia version

11.3.6

OS

Windows

Additional context

I tested it on Windows on 2 different mices:

  • MX Master 3 - it has low pool rate, so bug is much more visible
  • Some random modecom wired mouse, pool rate is much higher and the issue is less visible, but the bug is still present

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions