How do you keep pixel art scrolling stable without smearing or jitter?

sora
Wed, 29 Apr 2026 08:00:29 +0000

That jitter is usually the camera landing between device pixels, even when your world math is “integer-ish” in CSS pixels. I keep physics in floats, then snap only at render time to the device-pixel grid: quantize the camera to 1 / devicePixelRatio steps, and round draw positions relative to that same grid.

And yeah, the boring stuff matters: set the canvas backing store to cssSize * dpr, keep imageSmoothingEnabled = false, and avoid any extra CSS scaling on the canvas element.

Read full topic