Skip to content

Commit f99c570

Browse files
committed
Skip clamping for glyphs
1 parent 83eb415 commit f99c570

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/engine/Source/Scene/Billboard.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ function Billboard(options, billboardCollection) {
227227
this._updateClamping();
228228

229229
this._splitDirection = options.splitDirection ?? SplitDirection.NONE;
230+
// Primarily used by labels to indicate that the position is derived from the parent.
231+
// and expensive operations like clamping can be skipped.
232+
this._positionFromParent = false;
230233
}
231234

232235
const SHOW_INDEX = (Billboard.SHOW_INDEX = 0);
@@ -1147,6 +1150,7 @@ Billboard._updateClamping = function (collection, owner) {
11471150

11481151
if (
11491152
owner._heightReference === HeightReference.NONE ||
1153+
owner._positionFromParent ||
11501154
!defined(owner._position)
11511155
) {
11521156
return;

packages/engine/Source/Scene/LabelCollection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ function rebindAllGlyphs(labelCollection, label) {
294294
});
295295
billboard._labelDimensions = new Cartesian2();
296296
billboard._labelTranslate = new Cartesian2();
297+
billboard._positionFromParent = true;
297298
}
298299
glyph.billboard = billboard;
299300
}

0 commit comments

Comments
 (0)