Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] mbgl::View::getPixelRatio should be dynamic #5029

Closed
brunoabinader opened this issue May 13, 2016 · 4 comments
Closed

[core] mbgl::View::getPixelRatio should be dynamic #5029

brunoabinader opened this issue May 13, 2016 · 4 comments
Labels
bug Core The cross-platform C++ core, aka mbgl

Comments

@brunoabinader
Copy link
Member

Documentation for mbgl::View::getPixelRatio() says:

// Called directly after initialization. Must always return the same value, i.e. it may
// not change over time.

This is OK as long as the application window remains on a fixed device pixel ratio during its runtime. However, in my environment I have an external monitor connected to my MacBook. When moving the application window between the Retina display and the external monitor, the pixel ratio could also be updated.

@kkaefer @ansis is this something feasible for us to do?

@kkaefer
Copy link
Contributor

kkaefer commented May 13, 2016

We used to support that, but it turned out too much of a hassle. Since this only every occurs on Mac desktops, we punted on it.

@kkaefer kkaefer closed this as completed May 13, 2016
@mb12
Copy link

mb12 commented May 13, 2016

@brunoabinader Is it possible to detect the change in pixel ratio in platform specific bindibg? Calling setStyleURL with the currently loaded style upon change should fix it.

@kkaefer
Copy link
Contributor

kkaefer commented May 13, 2016

@mb12 The issue isn't about detecting the pixel ratio change event itself, but about everything that has to happen when we're changing the pixel ratio (e.g. recreate textures, scale + reload the spritesheet + atlas.

@1ec5
Copy link
Contributor

1ec5 commented May 13, 2016

This is also the source of crashes or unexpected behavior in the OS X SDK: #3451 #5010.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

4 participants