blob: c3911718e06a435f90974cce41de212153a56ed7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <mbgl/text/shaping.hpp>
#include <mbgl/style/style_properties.hpp>
namespace mbgl {
PositionedIcon shapeIcon(const Rect<uint16_t>& image, const SymbolLayoutProperties& layout) {
float dx = layout.icon.offset[0];
float dy = layout.icon.offset[1];
float x1 = dx - image.originalW / 2.0f;
float x2 = x1 + image.originalW;
float y1 = dy - image.originalH / 2.0f;
float y2 = y1 + image.originalH;
return PositionedIcon(image, y1, y2, x1, x2);
}
}
|