File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import bitmapSDF from "bitmap-sdf";
1111import BillboardCollection from "./BillboardCollection.js" ;
1212import BillboardTexture from "./BillboardTexture.js" ;
1313import BlendOption from "./BlendOption.js" ;
14- import { isHeightReferenceClamp } from "./HeightReference.js" ;
14+ import HeightReference , { isHeightReferenceClamp } from "./HeightReference.js" ;
1515import HorizontalOrigin from "./HorizontalOrigin.js" ;
1616import Label from "./Label.js" ;
1717import LabelStyle from "./LabelStyle.js" ;
@@ -306,7 +306,8 @@ function rebindAllGlyphs(labelCollection, label) {
306306 billboard . pixelOffset = label . _pixelOffset ;
307307 billboard . horizontalOrigin = HorizontalOrigin . LEFT ;
308308 billboard . verticalOrigin = label . _verticalOrigin ;
309- billboard . heightReference = label . _heightReference ;
309+ // To avoid excessive height update listeners, glyphs are not clamped. Their height values are updated manually by the owning label.
310+ billboard . heightReference = HeightReference . NONE ;
310311 billboard . scale = label . totalScale ;
311312 billboard . pickPrimitive = label ;
312313 billboard . id = label . _id ;
Original file line number Diff line number Diff line change @@ -2446,7 +2446,8 @@ describe("Scene/LabelCollection", function () {
24462446 } ) ;
24472447
24482448 expect ( l . _clampedPosition ) . toBeDefined ( ) ;
2449- expect ( l . _glyphs [ 0 ] . billboard . _clampedPosition ) . toBeDefined ( ) ;
2449+ // Glyphs are not truly clamped (to avoid excessive listeners and globe picks). They simply copy their owning label's clamped position.
2450+ expect ( l . _glyphs [ 0 ] . billboard . _clampedPosition ) . toBeUndefined ( ) ;
24502451
24512452 l . heightReference = HeightReference . NONE ;
24522453 expect ( l . _clampedPosition ) . toBeUndefined ( ) ;
@@ -2459,13 +2460,14 @@ describe("Scene/LabelCollection", function () {
24592460 text : "t" ,
24602461 position : Cartesian3 . fromDegrees ( - 72.0 , 40.0 ) ,
24612462 } ) ;
2463+ l . showBackground = true ;
24622464
24632465 await pollToPromise ( ( ) => {
24642466 scene . renderForSpecs ( ) ;
24652467 return labelsWithHeight . ready ;
24662468 } ) ;
24672469
2468- const billboard = l . _glyphs [ 0 ] . billboard ;
2470+ const billboard = l . _backgroundBillboard ;
24692471 expect ( billboard . _removeCallbackFunc ) . toBeDefined ( ) ;
24702472 const spy = spyOn ( billboard , "_removeCallbackFunc" ) ;
24712473 labelsWithHeight . remove ( l ) ;
You can’t perform that action at this time.
0 commit comments