Repository navigation
Never change pixel ratio after creating a Map object - #1799
Conversation
|
Agree with strategy here, particularly since:
|
e7c0a3a to
6f1d78d
Compare
There was a problem hiding this comment.
What's the rationale for introducing a separate argument rather than making framebufferSize part of TransformState?
There was a problem hiding this comment.
The TransformState is a status that is set for the map in general. It contains the extent (width/height) and position and is used to determine the tiles we need to load. The Framebuffer size is independent of the logical dimensions of the map and is always associated with a single frame, whereas TransformState represents the overall state of that map and isn't tied to a particular frame.
I plan to move additional data into FrameData, such as the animationTime.
6f1d78d to
a6663a5
Compare
|
CC @mikemorris -- mutable pixel ratio may be an important use-case for the node bindings. |
|
I think it shouldn't; instead of changing the dimensions of the map/view object for every request, we should cache those per size/ratio to save on memory allocation time. |
a6663a5 to
6a8d68a
Compare
|
@jfirebaugh mutable pixel ratios was causing issues like #1273, I'd be happy to see this gone and segment cache on ratio instead. |
|
Cool, sounds like this simplifies things all around then. |
also moves framebuffer size out of TransformState into its own object
6a8d68a to
675dddd
Compare
We're currently allowing users to change the pixel ratio after a Map object is created. There are very few use cases for this: moving a window from one screen to another on OS X, and connecting a TV to an iOS device. We should remove the ability to change the pixel ratio. If the frame buffer changes at some point, we can use
glViewportto resize the rendering to the new framebuffer dimensions. It won't look perfect, but it's an edge case that causes more headcache than it's worth.