summaryrefslogtreecommitdiff
path: root/src/geometry/text_buffer.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-09-05 13:40:45 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-09-05 13:40:45 -0700
commit4c0b4a79017bc7c7ae864e6f961f186605be617f (patch)
tree0266061b9634ba3bf78c7787e9f2dfd20b266663 /src/geometry/text_buffer.cpp
parent9d5f02ccaa051a0f3459f6fc94df807338fa2552 (diff)
downloadqtlocation-mapboxgl-4c0b4a79017bc7c7ae864e6f961f186605be617f.tar.gz
Match js attribute layout
Diffstat (limited to 'src/geometry/text_buffer.cpp')
-rw-r--r--src/geometry/text_buffer.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/geometry/text_buffer.cpp b/src/geometry/text_buffer.cpp
index b4b609b705..295ff02efa 100644
--- a/src/geometry/text_buffer.cpp
+++ b/src/geometry/text_buffer.cpp
@@ -19,14 +19,15 @@ size_t TextVertexBuffer::add(int16_t x, int16_t y, float ox, float oy, uint16_t
shorts[3] = std::round(oy * 64);
uint8_t *ubytes = static_cast<uint8_t *>(data);
- ubytes[8] = tx / 4;
- ubytes[9] = ty / 4;
- ubytes[10] = labelminzoom * 10;
- ubytes[11] = minzoom * 10; // 1/10 zoom levels: z16 == 160.
- ubytes[12] = fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160.
- ubytes[13] = (int16_t)round(angle * angleFactor) % 256;
- ubytes[14] = util::max((int16_t)std::round(range[0] * angleFactor), (int16_t)0) % 256;
- ubytes[15] = util::min((int16_t)std::round(range[1] * angleFactor), (int16_t)255) % 256;
+ ubytes[8] = labelminzoom * 10;
+ ubytes[9] = minzoom * 10; // 1/10 zoom levels: z16 == 160.
+ ubytes[10] = fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160.
+ ubytes[11] = (int16_t)round(angle * angleFactor) % 256;
+ ubytes[12] = util::max((int16_t)std::round(range[0] * angleFactor), (int16_t)0) % 256;
+ ubytes[13] = util::min((int16_t)std::round(range[1] * angleFactor), (int16_t)255) % 256;
+
+ ubytes[14] = tx / 4;
+ ubytes[15] = ty / 4;
return idx;
}