@@ -207,19 +207,13 @@ function updateLineLabels(bucket: SymbolBucket,
207
207
}
208
208
}
209
209
210
- function placeFirstAndLastGlyph ( fontScale : number , glyphOffsetArray : GlyphOffsetArray , lineOffsetX : number , lineOffsetY : number , flip : boolean , anchorPoint : Point , tileAnchorPoint : Point , symbol : any , lineVertexArray : SymbolLineVertexArray , labelPlaneMatrix : mat4 , projectionCache : any , conservativePlacement : boolean ) {
210
+ function placeFirstAndLastGlyph ( fontScale : number , glyphOffsetArray : GlyphOffsetArray , lineOffsetX : number , lineOffsetY : number , flip : boolean , anchorPoint : Point , tileAnchorPoint : Point , symbol : any , lineVertexArray : SymbolLineVertexArray , labelPlaneMatrix : mat4 , projectionCache : any ) {
211
211
const glyphEndIndex = symbol . glyphStartIndex + symbol . numGlyphs ;
212
212
const lineStartIndex = symbol . lineStartIndex ;
213
213
const lineEndIndex = symbol . lineStartIndex + symbol . lineLength ;
214
214
215
- let firstGlyphOffset = glyphOffsetArray . getoffsetX ( symbol . glyphStartIndex ) ;
216
- let lastGlyphOffset = glyphOffsetArray . getoffsetX ( glyphEndIndex - 1 ) ;
217
-
218
- if ( conservativePlacement ) {
219
- const maxOffset = Math . max ( Math . abs ( firstGlyphOffset ) , Math . abs ( lastGlyphOffset ) ) ;
220
- firstGlyphOffset = - maxOffset ;
221
- lastGlyphOffset = maxOffset ;
222
- }
215
+ const firstGlyphOffset = glyphOffsetArray . getoffsetX ( symbol . glyphStartIndex ) ;
216
+ const lastGlyphOffset = glyphOffsetArray . getoffsetX ( glyphEndIndex - 1 ) ;
223
217
224
218
const firstPlacedGlyph = placeGlyphAlongLine ( fontScale * firstGlyphOffset , lineOffsetX , lineOffsetY , flip , anchorPoint , tileAnchorPoint , symbol . segment ,
225
219
lineStartIndex , lineEndIndex , lineVertexArray , labelPlaneMatrix , projectionCache ) ;
@@ -268,7 +262,7 @@ function placeGlyphsAlongLine(symbol, fontSize, flip, keepUpright, posMatrix, la
268
262
269
263
// Place the first and the last glyph in the label first, so we can figure out
270
264
// the overall orientation of the label and determine whether it needs to be flipped in keepUpright mode
271
- const firstAndLastGlyph = placeFirstAndLastGlyph ( fontScale , glyphOffsetArray , lineOffsetX , lineOffsetY , flip , anchorPoint , tileAnchorPoint , symbol , lineVertexArray , labelPlaneMatrix , projectionCache , false ) ;
265
+ const firstAndLastGlyph = placeFirstAndLastGlyph ( fontScale , glyphOffsetArray , lineOffsetX , lineOffsetY , flip , anchorPoint , tileAnchorPoint , symbol , lineVertexArray , labelPlaneMatrix , projectionCache ) ;
272
266
if ( ! firstAndLastGlyph ) {
273
267
return { notEnoughRoom : true } ;
274
268
}
0 commit comments