Skip to content

Commit 3007a50

Browse files
committed
Fix incorrect shader selection for text labels with inline images
1 parent cc88843 commit 3007a50

3 files changed

Lines changed: 60 additions & 1 deletion

File tree

2.8 KB
Loading
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"height": 128,
6+
"width": 128
7+
}
8+
},
9+
"center": [ 0, 0 ],
10+
"zoom": 0,
11+
"sources": {
12+
"point": {
13+
"type": "geojson",
14+
"data": {
15+
"type": "FeatureCollection",
16+
"features": [
17+
{
18+
"type": "Feature",
19+
"geometry": {
20+
"type": "Point",
21+
"coordinates": [ 0, 20 ]
22+
},
23+
"properties": {
24+
"iconsInText": "yes"
25+
}
26+
},
27+
{
28+
"type": "Feature",
29+
"geometry": {
30+
"type": "Point",
31+
"coordinates": [ 0, -20 ]
32+
}
33+
}
34+
]
35+
}
36+
}
37+
},
38+
"glyphs": "local://glyphs/{fontstack}/{range}.pbf",
39+
"sprite": "local://sprites/emerald@2x",
40+
"layers": [
41+
{
42+
"id": "text",
43+
"type": "symbol",
44+
"source": "point",
45+
"layout": {
46+
"text-field": [
47+
"case",
48+
["==", ["get", "iconsInText"], "yes"],
49+
["format", "IconsInText", ["image", "london-underground"]],
50+
["format", "TextOnly"]
51+
],
52+
"text-font": [
53+
"Open Sans Semibold",
54+
"Arial Unicode MS Bold"
55+
]
56+
}
57+
}
58+
]
59+
}

src/mbgl/layout/symbol_layout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ void SymbolLayout::prepareSymbols(const GlyphMap& glyphMap,
744744

745745
// if either shapedText or icon position is present, add the feature
746746
const Shaping& defaultShaping = getDefaultHorizontalShaping(shapedTextOrientations);
747-
iconsInText = defaultShaping && defaultShaping.iconsInText;
747+
iconsInText |= defaultShaping && defaultShaping.iconsInText;
748748
if (defaultShaping || shapedIcon) {
749749
addFeature(std::distance(features.begin(), it),
750750
feature,

0 commit comments

Comments
 (0)