diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-03-22 12:19:11 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-03-22 13:24:26 -0700 |
commit | 673f9e364804b4c3f449c8619e767a7b40e5350e (patch) | |
tree | 8db883579cd96a3a6c135c75f0c53cac9551666e | |
parent | 61e6e626638144607c5dd7766a854b3ffa232e00 (diff) | |
download | qtlocation-mapboxgl-673f9e364804b4c3f449c8619e767a7b40e5350e.tar.gz |
[core] Double maximum label width by reducing glyph precision.
Fixes issue #11507.
Port of GL JS PR #6375.
m--------- | mapbox-gl-js | 0 | ||||
-rw-r--r-- | src/mbgl/programs/symbol_program.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/shaders/symbol_icon.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/shaders/symbol_sdf.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/mapbox-gl-js b/mapbox-gl-js -Subproject 11552cf2792ca239b18d7c77663492ead6365cb +Subproject 3c07b72a59d78bc6240a8e3d77a54bec7619af5 diff --git a/src/mbgl/programs/symbol_program.hpp b/src/mbgl/programs/symbol_program.hpp index a14afac702..9b5037ed9f 100644 --- a/src/mbgl/programs/symbol_program.hpp +++ b/src/mbgl/programs/symbol_program.hpp @@ -61,8 +61,8 @@ struct SymbolLayoutAttributes : gl::Attributes< {{ static_cast<int16_t>(labelAnchor.x), static_cast<int16_t>(labelAnchor.y), - static_cast<int16_t>(::round(o.x * 64)), // use 1/64 pixels for placement - static_cast<int16_t>(::round((o.y + glyphOffsetY) * 64)) + static_cast<int16_t>(::round(o.x * 32)), // use 1/32 pixels for placement + static_cast<int16_t>(::round((o.y + glyphOffsetY) * 32)) }}, {{ tx, diff --git a/src/mbgl/shaders/symbol_icon.cpp b/src/mbgl/shaders/symbol_icon.cpp index da31d36291..c037c81005 100644 --- a/src/mbgl/shaders/symbol_icon.cpp +++ b/src/mbgl/shaders/symbol_icon.cpp @@ -105,7 +105,7 @@ void main() { mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); - gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0); + gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); v_tex = a_tex / u_texsize; vec2 fade_opacity = unpack_opacity(a_fade_opacity); diff --git a/src/mbgl/shaders/symbol_sdf.cpp b/src/mbgl/shaders/symbol_sdf.cpp index 46bab10be5..b584c00315 100644 --- a/src/mbgl/shaders/symbol_sdf.cpp +++ b/src/mbgl/shaders/symbol_sdf.cpp @@ -183,7 +183,7 @@ void main() { mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); - gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0); + gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); float gamma_scale = gl_Position.w; vec2 tex = a_tex / u_texsize; |