diff --git a/src/data/bucket/symbol_bucket.js b/src/data/bucket/symbol_bucket.js index b123f655879..50735204fa9 100644 --- a/src/data/bucket/symbol_bucket.js +++ b/src/data/bucket/symbol_bucket.js @@ -104,8 +104,8 @@ function addVertex(array, anchorX, anchorY, ox, oy, tx, ty, sizeVertex) { // a_pos_offset anchorX, anchorY, - Math.round(ox * 64), - Math.round(oy * 64), + Math.round(ox * 32), + Math.round(oy * 32), // a_data tx, // x coordinate of symbol on glyph atlas texture diff --git a/src/shaders/symbol_icon.vertex.glsl b/src/shaders/symbol_icon.vertex.glsl index 31edb089676..d804dfd5bbd 100644 --- a/src/shaders/symbol_icon.vertex.glsl +++ b/src/shaders/symbol_icon.vertex.glsl @@ -79,7 +79,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/shaders/symbol_sdf.vertex.glsl b/src/shaders/symbol_sdf.vertex.glsl index c562dda1efb..261191b3772 100644 --- a/src/shaders/symbol_sdf.vertex.glsl +++ b/src/shaders/symbol_sdf.vertex.glsl @@ -101,7 +101,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; diff --git a/test/integration/render-tests/text-max-width/unlimited/expected.png b/test/integration/render-tests/text-max-width/unlimited/expected.png new file mode 100644 index 00000000000..8b525273c51 Binary files /dev/null and b/test/integration/render-tests/text-max-width/unlimited/expected.png differ diff --git a/test/integration/render-tests/text-max-width/unlimited/style.json b/test/integration/render-tests/text-max-width/unlimited/style.json new file mode 100644 index 00000000000..bea1403e570 --- /dev/null +++ b/test/integration/render-tests/text-max-width/unlimited/style.json @@ -0,0 +1,55 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 512 + } + }, + "zoom": 1, + "sources": { + "mapbox": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -80, + 0 + ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "white" + } + }, + { + "id": "literal", + "type": "symbol", + "source": "mapbox", + "layout": { + "text-field": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ], + "text-max-width": 0, + "text-anchor": "left" + } + } + ] +}