diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2015-01-16 13:37:13 -0500 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2015-01-16 13:37:13 -0500 |
commit | 1ce0ca0b7a38218e53601b0b1e9d72a3ff55e52e (patch) | |
tree | 0c1c84e381bb057c81e8ae2faee427cb26c015ba /src/mbgl/geometry/line_atlas.cpp | |
parent | 221d256beae6ff06754ee52feffbfc2953df699b (diff) | |
download | qtlocation-mapboxgl-1ce0ca0b7a38218e53601b0b1e9d72a3ff55e52e.tar.gz |
add warning when line atlas is overflowed
Diffstat (limited to 'src/mbgl/geometry/line_atlas.cpp')
-rw-r--r-- | src/mbgl/geometry/line_atlas.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp index 7485ef31a7..5cfb67021f 100644 --- a/src/mbgl/geometry/line_atlas.cpp +++ b/src/mbgl/geometry/line_atlas.cpp @@ -33,7 +33,6 @@ LinePatternPos LineAtlas::getDashPosition(const std::vector<float> &dasharray, b std::string key = sskey.str(); if (positions.find(key) == positions.end()) { - //fprintf(stderr, "add %s\n", key.c_str()); positions[key] = addDash(dasharray, round); } @@ -46,7 +45,10 @@ LinePatternPos LineAtlas::addDash(const std::vector<float> &dasharray, bool roun int dashheight = 2 * n + 1; const uint8_t offset = 128; - // TODO check if enough space + if (nextRow + dashheight > height) { + fprintf(stderr, "[WARNING] line atlas bitmap overflow\n"); + return LinePatternPos(); + } float length = 0; for (const float &part : dasharray) { |