[core][ios][osx][android] make SpriteImage accept PremultipliedImage
the SpriteImage constructor signature changes from
SpriteImage(
uint16_t width, uint16_t height, float pixelRatio,
std::string&& data, bool sdf = false);
to
SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
This commit is contained in:
@@ -6,10 +6,10 @@ namespace mbgl {
|
||||
PositionedIcon shapeIcon(const SpriteAtlasElement& image, const SymbolLayoutProperties& layout) {
|
||||
float dx = layout.icon.offset.value[0];
|
||||
float dy = layout.icon.offset.value[1];
|
||||
float x1 = dx - image.texture->width / 2.0f;
|
||||
float x2 = x1 + image.texture->width;
|
||||
float y1 = dy - image.texture->height / 2.0f;
|
||||
float y2 = y1 + image.texture->height;
|
||||
float x1 = dx - image.spriteImage->getWidth() / 2.0f;
|
||||
float x2 = x1 + image.spriteImage->getWidth();
|
||||
float y1 = dy - image.spriteImage->getHeight() / 2.0f;
|
||||
float y2 = y1 + image.spriteImage->getHeight();
|
||||
|
||||
return PositionedIcon(image, y1, y2, x1, x2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user