Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If it's safe to set pixelRatio to a big number such as 10? #1620

Closed
gyhyfj opened this issue Aug 8, 2023 · 1 comment
Closed

If it's safe to set pixelRatio to a big number such as 10? #1620

gyhyfj opened this issue Aug 8, 2023 · 1 comment

Comments

@gyhyfj
Copy link

gyhyfj commented Aug 8, 2023

Currently, if I open a chrome window on my laptop(devicePixelRatio 1.25), and init the stage, then drag this window to my extra screen(devicePixelRatio 1), items in layer could be a bit blur and canot be clear as expected.

So I have to detect devicePixelRatio change and then reset this value by setPixelRatio .

But if I run setPixelRatio(10) when init stage, this problem won't come out again.

I'm not sure if it's ok to solve this problem if I just set pixel ratio to a big number at start. Could it lead to some other troubles?
Sorry but I'm not sure why these happend 🙏

@lavrton
Copy link
Member

lavrton commented Aug 8, 2023

pixelRatio = 10 is probably too large. Usually, HDPI devices have maximum pixelRatio = 2. So I don't think using large number makes much sense.

Large pixel ratio will drop performance of the application. It makes canvas element much bigger with a lot more pixels to calculate and render.

@lavrton lavrton closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants