Add Canvas.Invalidate for coalesced desktop repaints
- Status
- Fixed
- Fixed in
- v26.10.3
- Area
- desktop
- Source discussion
- https://forum.objo.dev/d/1354-some-feedback-from-building-chartview-web-support-and-a-few-language-notes
- Last updated
- 2026-10-20
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
On desktop, every Canvas.Refresh() call executes the Paint handler synchronously, once per call. In a MouseDrag loop this means one full repaint per drag event; the events queue up behind the repaints and the display lags behind the mouse. Developers currently work around it with a timer that merges repaints.
Requested: a Canvas.Invalidate() method that schedules a single coalesced repaint at the next drawing opportunity, so repeated calls within a frame produce one Paint. This matches Xojo's Canvas.Invalidate, where Refresh repaints immediately and Invalidate repaints at the next opportunity. Refresh() keeps its current synchronous semantics for code that reads the canvas back (for example ToPicture) right after repainting.