Skip to content

Canvas/WebGL can get fuzzy when dragged to high-DPI monitors #1585

@jonathanolson

Description

@jonathanolson

We aren't listening for devicePixelRatio changes (and should be).

To reproduce, open up a sim that uses WebGL (natural-selection, neuron, etc.) or set ?rootRenderer=canvas, and:

  1. Load the simulation on a lower-DPI monitor
  2. Move the browser to a higher-DPI monitor
  3. The simulation's Canvas/WebGL parts will be blurrier than if you reload (or load from the start on the high-DPI monitor)

Loaded high-DPI on high-DPI:
image

Loaded low-DPI on high-DPI:
image

It looks like this is possible with matchMedia, example in https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions