@@ -16,13 +16,15 @@ function drawSymbols(painter, source, layer, coords) {
1616
1717 var gl = painter . gl ;
1818
19+ // Disable the stencil test so that labels aren't clipped to tile boundaries.
20+ //
21+ // Layers with features that may be drawn overlapping aren't clipped. These
22+ // layers are sorted in the y direction, and to draw the correct ordering near
23+ // tile edges the icons are included in both tiles and clipped when drawing.
1924 if ( drawAcrossEdges ) {
20- // Disable the stencil test so that labels aren't clipped to tile boundaries.
21- //
22- // Layers with features that may be drawn overlapping aren't clipped. These
23- // layers are sorted in the y direction, and to draw the correct ordering near
24- // tile edges the icons are included in both tiles and clipped when drawing.
2525 gl . disable ( gl . STENCIL_TEST ) ;
26+ } else {
27+ gl . enable ( gl . STENCIL_TEST ) ;
2628 }
2729
2830 painter . setDepthSublayer ( 0 ) ;
@@ -57,12 +59,9 @@ function drawSymbols(painter, source, layer, coords) {
5759 drawSymbol ( painter , layer , posMatrix , tile , elementGroups . glyph , 'text' , true , false ) ;
5860 }
5961
60- drawCollisionDebug ( painter , source , layer , coords ) ;
61-
62- if ( drawAcrossEdges ) {
63- gl . enable ( gl . STENCIL_TEST ) ;
64- }
6562 gl . enable ( gl . DEPTH_TEST ) ;
63+
64+ drawCollisionDebug ( painter , source , layer , coords ) ;
6665}
6766
6867var defaultSizes = {
0 commit comments