From 5727f04c4311a6aaa44116a5fb2d26db7ab9e5de Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Fri, 20 Feb 2026 05:34:43 +0900 Subject: [PATCH] Fix incorrect shader selection for text labels with inline images (#4082) --- .../formatted-images-mixed/expected.png | Bin 0 -> 2868 bytes .../formatted-images-mixed/style.json | 59 ++++++++++++++++++ src/mbgl/layout/symbol_layout.cpp | 2 +- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 metrics/integration/render-tests/text-field/formatted-images-mixed/expected.png create mode 100644 metrics/integration/render-tests/text-field/formatted-images-mixed/style.json diff --git a/metrics/integration/render-tests/text-field/formatted-images-mixed/expected.png b/metrics/integration/render-tests/text-field/formatted-images-mixed/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..8a6165ef7440f9af5860f7f256310347cf04176c GIT binary patch literal 2868 zcmaJ@dpHve7Z+jHP-D#8USWy3tk7J_{eHMVS_fLPEbDnd1&Uv2mJI^^}4|fMiAPguZBqZtNXzRHz zGyW!k*gj{T2^tX+0`5B5T6y6Pe5OmJO_1>9;`up6+u_%T76Oh(#>&DHScep8DEk{-O9V%V4(aBYFZC_0OP4S~dOTZDbTFM`( z@psd|o2v(^H8}Ome$&Z5YzzHjE`E{s0T&5fJXC&?pU z%hz{zU+qzWP&Zqyx3#@a{GPJ7dFEm0Y*snp8#XqvcQVX>tL1~Ac=>YGMZOVe;wy;V z!DX`7C>wzYcJK)}4^+T{f*yTeC#Bm^zb>QErY~W=vp@VssGmw-?%v&_yo^?{u&=?I zc1}F_^W6y6(w+nHXeZ2+I863E^B}_4oNxbj-P+{Qu)hy*DZ;L~K^FMV<-aDE{(>?O zqV^sj3nO>Q9{Bq^9UI^aSc$Du zm#OW2=$duWE80&M#HduN{KC;1Eoz7qW5SnM22m!Jbtop{WKJz8>_Oa_bS+MrE9(vz zpP)k^YeEYL8d(>s;Amo*0nn^oqAdij!m#$ob5DPCWd=tezD2ib5)O_^xr!ZT;UP#V%lI`PvQ*Jl1#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1Q znPPi#k?Vy&Fo3HJ>wp3?h;ngU6`2KwK*?h7vnHS<6`azB6N2v3aV(CdZhFCa3Qg7z zf_&&CJPFj1Z3k>L$o^;tQXs!Gi+o8e@QlIXC7j|$WE%{R&XMNBtGjwShy347Us%v3 z6Tq90in#+yq_)6r_e$`9qeBo}g`>5IeN@1=tI9h7B~o`J68kdtwMO=D{YA%d);sC< kfttVA-u*w+xa_BBo||dNr`X!@{cl*v$-hf-<3%^<^TWy literal 0 HcmV?d00001 diff --git a/metrics/integration/render-tests/text-field/formatted-images-mixed/style.json b/metrics/integration/render-tests/text-field/formatted-images-mixed/style.json new file mode 100644 index 000000000..3740918c6 --- /dev/null +++ b/metrics/integration/render-tests/text-field/formatted-images-mixed/style.json @@ -0,0 +1,59 @@ +{ + "version": 8, + "metadata": { + "test": { + "height": 128, + "width": 128 + } + }, + "center": [ 0, 0 ], + "zoom": 0, + "sources": { + "point": { + "type": "geojson", + "data": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, 20 ] + }, + "properties": { + "iconsInText": "yes" + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [ 0, -20 ] + } + } + ] + } + } + }, + "glyphs": "local://glyphs/{fontstack}/{range}.pbf", + "sprite": "local://sprites/emerald@2x", + "layers": [ + { + "id": "text", + "type": "symbol", + "source": "point", + "layout": { + "text-field": [ + "case", + ["==", ["get", "iconsInText"], "yes"], + ["format", "IconsInText", ["image", "london-underground"]], + ["format", "TextOnly"] + ], + "text-font": [ + "Open Sans Semibold", + "Arial Unicode MS Bold" + ] + } + } + ] +} diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index a01c0e862..8c216c40e 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -744,7 +744,7 @@ void SymbolLayout::prepareSymbols(const GlyphMap& glyphMap, // if either shapedText or icon position is present, add the feature const Shaping& defaultShaping = getDefaultHorizontalShaping(shapedTextOrientations); - iconsInText = defaultShaping && defaultShaping.iconsInText; + iconsInText |= defaultShaping && defaultShaping.iconsInText; if (defaultShaping || shapedIcon) { addFeature(std::distance(features.begin(), it), feature,