Skip to content

Commit a455bca

Browse files
committed
Move defined check into upgradeBackgroundBillboard
1 parent fba8093 commit a455bca

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

packages/engine/Source/Scene/LabelCollection.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,12 @@ function rebindAllGlyphs(labelCollection, label) {
162162
);
163163
label._backgroundBillboard = backgroundBillboard;
164164
}
165-
if (defined(backgroundBillboard)) {
166-
updateBackgroundBillboard(
167-
backgroundBillboardCollection,
168-
label,
169-
backgroundBillboard,
170-
);
171-
}
165+
166+
updateBackgroundBillboard(
167+
backgroundBillboardCollection,
168+
label,
169+
backgroundBillboard,
170+
);
172171

173172
const glyphBillboardCollection = labelCollection._glyphBillboardCollection;
174173
const glyphTextureCache = glyphBillboardCollection.billboardTextureCache;
@@ -318,6 +317,9 @@ function updateBackgroundBillboard(
318317
label,
319318
backgroundBillboard,
320319
) {
320+
if (!defined(backgroundBillboard)) {
321+
return;
322+
}
321323
const showBackground =
322324
label.show &&
323325
label._showBackground &&

0 commit comments

Comments
 (0)