[core] use float for storing opacity attribute
This commit is contained in:
@@ -16,7 +16,7 @@ MBGL_DEFINE_ATTRIBUTE(int16_t, 2, label_pos);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 2, anchor_pos);
|
||||
MBGL_DEFINE_ATTRIBUTE(uint16_t, 2, texture_pos);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 4, normal_ed);
|
||||
MBGL_DEFINE_ATTRIBUTE(uint8_t, 1, fade_opacity);
|
||||
MBGL_DEFINE_ATTRIBUTE(float, 1, fade_opacity);
|
||||
MBGL_DEFINE_ATTRIBUTE(uint8_t, 2, placed);
|
||||
MBGL_DEFINE_ATTRIBUTE(uint16_t, 3, size);
|
||||
MBGL_DEFINE_ATTRIBUTE(float, 1, offset);
|
||||
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
|
||||
static gfx::Vertex<SymbolOpacityAttributes> opacityVertex(bool placed, float opacity) {
|
||||
return {
|
||||
{{ static_cast<uint8_t>((static_cast<uint8_t>(opacity * 127) << 1) | static_cast<uint8_t>(placed)) }}
|
||||
{{ static_cast<float>((static_cast<uint8_t>(opacity * 127) << 1) | static_cast<uint8_t>(placed)) }}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user