-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cannot set style image to image of different dimensions #7618
Comments
This is prohibited because it's a complex operation to support. The process would have to be:
|
Previously: #6735 (comment). |
What if the new dimensions fit within the old dimensions? |
The only case where it's safe to update in place is if the dimensions don't change. Otherwise, existing buffers which use the prior dimensions may render incorrectly. |
The same caveat applies to code that calls |
Calling |
What I’m getting at is that e.g. |
Per #4556 (comment), this issue also affects the annotation API, which implements custom point annotation images by removing the in-use style image and adding a new one under the same name. |
mbgl::SpriteAtlas::_setSprite()
disallows replacing an existing image with an image of different dimensions. I assume this is because the image would potentially no longer fit in the same location in the sprite sheet, but this behavior is confusing for anyone who isn’t familiar with how the sprite sheet works. Instead, if the new dimensions are larger than the original dimensions, this method should remove the old image and add the new image under the same name but in a new location within the sprite sheet./cc @tmpsantos
The text was updated successfully, but these errors were encountered: