Skip to content

Commit 6841af7

Browse files
ibesoragithub-actions[bot]
authored andcommitted
Fix stretchable icons without icon-text-fix rendering with an incorrect size
GitOrigin-RevId: 6dd620523f86db0ad008070cd526264b38452ded
1 parent 4679f5a commit 6841af7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/symbol/quads.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export function getIconQuads(
177177
return {tl, tr, bl, br, texPrimary: subRect, texSecondary: subRectB, writingMode: undefined, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY, isSDF: isSDFIcon};
178178
};
179179

180-
if (!hasIconTextFit || (!image.stretchX && !image.stretchY)) {
180+
if (!image.stretchX && !image.stretchY) {
181181
quads.push(makeBox(
182182
{fixed: 0, stretch: -1},
183183
{fixed: 0, stretch: -1},
@@ -208,7 +208,7 @@ export function getIconQuadsNumber(image: ImagePosition, hasIconTextFit: boolean
208208
const stretchX = image.stretchX || [[0, imageWidth]];
209209
const stretchY = image.stretchY || [[0, imageHeight]];
210210

211-
if (!hasIconTextFit || (!image.stretchX && !image.stretchY)) {
211+
if (!image.stretchX && !image.stretchY) {
212212
return 1;
213213
}
214214

test/ignores/all.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ const skip = [
137137
// Current behavior is arbitrary
138138
"render-tests/geojson/inline-linestring-fill",
139139

140-
// Broken in similar way as gl-native https://mapbox.atlassian.net/browse/MAPSNAT-3407
141-
"render-tests/icon-size/small-stretch-area",
142-
143140
// Broken in similar way as gl-native https://mapbox.atlassian.net/browse/MAPSNAT-3482
144141
"render-tests/appearance/empty-image-in-appearance",
145142
"render-tests/appearance/icon-text-fit-vertical/non-existent-image",

0 commit comments

Comments
 (0)