Skip to content

Commit ecb38f9

Browse files
Andrcraft9github-actions[bot]
authored andcommitted
Disable sortFeaturesByY if a bucket has multiple segments
GitOrigin-RevId: 8865b8b513633b3783a410291359b37d43de6181
1 parent f58886f commit ecb38f9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/data/bucket/symbol_bucket.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,14 @@ class SymbolBucket implements Bucket {
20802080

20812081
// The current approach to sorting doesn't sort across segments so don't try.
20822082
// Sorting within segments separately seemed not to be worth the complexity.
2083-
if (this.text.segments.get().length > 1 || this.icon.segments.get().length > 1) return;
2083+
if (this.text.segments.get().length > 1 || this.icon.segments.get().length > 1) {
2084+
// Disable sorting if there are multiple segments as the current approach doesn't sort within segments.
2085+
//
2086+
// Note: Force-disabling is a good practice here to prevent sorting logic that is unsupported in this
2087+
// particular case.
2088+
this.sortFeaturesByY = false;
2089+
return;
2090+
}
20842091

20852092
// If the symbols are allowed to overlap sort them by their vertical screen position.
20862093
// The index array buffer is rewritten to reference the (unchanged) vertices in the

0 commit comments

Comments
 (0)