fix(pdf): avoid toReversed in icon size resolution (#3129)

This commit is contained in:
Lihan YANG
2026-06-01 16:33:04 +08:00
committed by GitHub
parent 8e72311bc6
commit e00ff8ceca
@@ -17,7 +17,12 @@ export const parseStyleFontSize = (fontSize: Style["fontSize"] | undefined): num
export const resolveStyleFontSize = (...styles: StyleInput[]): number | undefined => {
for (let index = styles.length - 1; index >= 0; index -= 1) {
for (const style of composeStyles(styles[index]).toReversed()) {
const composedStyles = composeStyles(styles[index]);
for (let styleIndex = composedStyles.length - 1; styleIndex >= 0; styleIndex -= 1) {
const style = composedStyles[styleIndex];
if (style === undefined) continue;
const fontSize = parseStyleFontSize(style.fontSize);
if (fontSize !== undefined) return fontSize;
}