Skip to content

Scrollables do not obey MediaQuery devicePixelRatio  #29916

@mehmetf

Description

@mehmetf

A client in Google is trying to scale the contents of their screen to other screen factors using a combination of Transform and creating a new MediaQuery. Something along these lines:

Transform(
  transform: Matrix4.diagonal3Values(transformScale, transformScale, 1.0),
  child: MediaQuery(
    data: parentMediaQuery.copyWith(
      size: virtualSize,
      devicePixelRatio: transformScale * parentMediaQuery.devicePixelRatio),
    child: child),
);

This works pretty well for their intended use case (e.g. the touch input coordinates are transformed correctly). However, they noticed that the drag gesture is not scaling properly. They worked around this by modifying the device pixel ratio in the embedder. Discussion with @chinmaygarde and others have indicated this is a heavy weight solution and we should instead look into fixing this in the framework; hence this issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions