@@ -316,7 +316,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
316
316
var glyphPixelOffset = new Cartesian2 ( ) ;
317
317
var scratchBackgroundPadding = new Cartesian2 ( ) ;
318
318
319
- function repositionAllGlyphs ( label , resolutionScale ) {
319
+ function repositionAllGlyphs ( label ) {
320
320
var glyphs = label . _glyphs ;
321
321
var text = label . _renderedText ;
322
322
var glyph ;
@@ -378,7 +378,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
378
378
backgroundBillboard . _labelHorizontalOrigin = horizontalOrigin ;
379
379
}
380
380
381
- glyphPixelOffset . x = widthOffset * scale * resolutionScale ;
381
+ glyphPixelOffset . x = widthOffset * scale ;
382
382
glyphPixelOffset . y = 0 ;
383
383
384
384
var firstCharOfLine = true ;
@@ -390,7 +390,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
390
390
lineOffsetY += lineSpacing ;
391
391
lineWidth = lineWidths [ lineIndex ] ;
392
392
widthOffset = calculateWidthOffset ( lineWidth , horizontalOrigin , backgroundPadding ) ;
393
- glyphPixelOffset . x = widthOffset * scale * resolutionScale ;
393
+ glyphPixelOffset . x = widthOffset * scale ;
394
394
firstCharOfLine = true ;
395
395
} else {
396
396
glyph = glyphs [ glyphIndex ] ;
@@ -409,12 +409,12 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
409
409
glyphPixelOffset . y = otherLinesHeight + maxGlyphDescent + backgroundPadding . y ;
410
410
glyphPixelOffset . y -= SDFSettings . PADDING ;
411
411
}
412
- glyphPixelOffset . y = ( glyphPixelOffset . y - dimensions . descent - lineOffsetY ) * scale * resolutionScale ;
412
+ glyphPixelOffset . y = ( glyphPixelOffset . y - dimensions . descent - lineOffsetY ) * scale ;
413
413
414
414
// Handle any offsets for the first character of the line since the bounds might not be right on the bottom left pixel.
415
415
if ( firstCharOfLine )
416
416
{
417
- glyphPixelOffset . x -= SDFSettings . PADDING * scale * resolutionScale ;
417
+ glyphPixelOffset . x -= SDFSettings . PADDING * scale ;
418
418
firstCharOfLine = false ;
419
419
}
420
420
@@ -430,7 +430,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
430
430
//as well as any applied scale.
431
431
if ( glyphIndex < glyphLength - 1 ) {
432
432
var nextGlyph = glyphs [ glyphIndex + 1 ] ;
433
- glyphPixelOffset . x += ( ( dimensions . width - dimensions . bounds . minx ) + nextGlyph . dimensions . bounds . minx ) * scale * resolutionScale ;
433
+ glyphPixelOffset . x += ( ( dimensions . width - dimensions . bounds . minx ) + nextGlyph . dimensions . bounds . minx ) * scale ;
434
434
}
435
435
}
436
436
}
@@ -443,7 +443,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
443
443
} else {
444
444
widthOffset = 0 ;
445
445
}
446
- glyphPixelOffset . x = widthOffset * scale * resolutionScale ;
446
+ glyphPixelOffset . x = widthOffset * scale ;
447
447
448
448
if ( verticalOrigin === VerticalOrigin . TOP ) {
449
449
glyphPixelOffset . y = maxLineHeight - maxGlyphY - maxGlyphDescent ;
@@ -455,7 +455,7 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
455
455
// VerticalOrigin.BOTTOM
456
456
glyphPixelOffset . y = 0 ;
457
457
}
458
- glyphPixelOffset . y = glyphPixelOffset . y * scale * resolutionScale ;
458
+ glyphPixelOffset . y = glyphPixelOffset . y * scale ;
459
459
460
460
backgroundBillboard . width = totalLineWidth ;
461
461
backgroundBillboard . height = totalLineHeight ;
@@ -566,7 +566,6 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
566
566
this . _labels = [ ] ;
567
567
this . _labelsToUpdate = [ ] ;
568
568
this . _totalGlyphCount = 0 ;
569
- this . _resolutionScale = undefined ;
570
569
571
570
this . _highlightColor = Color . clone ( Color . WHITE ) ; // Only used by Vector3DTilePoints
572
571
@@ -844,21 +843,9 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
844
843
addWhitePixelCanvas ( this . _backgroundTextureAtlas , this ) ;
845
844
}
846
845
847
- var uniformState = context . uniformState ;
848
- var resolutionScale = uniformState . pixelRatio ;
849
- var resolutionChanged = this . _resolutionScale !== resolutionScale ;
850
- this . _resolutionScale = resolutionScale ;
851
-
852
- var labelsToUpdate ;
853
- if ( resolutionChanged ) {
854
- labelsToUpdate = this . _labels ;
855
- } else {
856
- labelsToUpdate = this . _labelsToUpdate ;
857
- }
858
-
859
- var len = labelsToUpdate . length ;
846
+ var len = this . _labelsToUpdate . length ;
860
847
for ( var i = 0 ; i < len ; ++ i ) {
861
- var label = labelsToUpdate [ i ] ;
848
+ var label = this . _labelsToUpdate [ i ] ;
862
849
if ( label . isDestroyed ( ) ) {
863
850
continue ;
864
851
}
@@ -870,8 +857,8 @@ import GraphemeSplitter from '../ThirdParty/graphemesplitter.js';
870
857
label . _rebindAllGlyphs = false ;
871
858
}
872
859
873
- if ( resolutionChanged || label . _repositionAllGlyphs ) {
874
- repositionAllGlyphs ( label , resolutionScale ) ;
860
+ if ( label . _repositionAllGlyphs ) {
861
+ repositionAllGlyphs ( label ) ;
875
862
label . _repositionAllGlyphs = false ;
876
863
}
877
864
0 commit comments