diff --git a/packages/react-native-enriched-markdown/ios/internals/MeasurementCache.h b/packages/react-native-enriched-markdown/ios/internals/MeasurementCache.h index 7b4d95356..94f1e5887 100644 --- a/packages/react-native-enriched-markdown/ios/internals/MeasurementCache.h +++ b/packages/react-native-enriched-markdown/ios/internals/MeasurementCache.h @@ -43,16 +43,19 @@ struct MeasurementCacheKey { size_t styleFingerprint; CGFloat fontScale; MarkdownFlavor flavor; + std::string lineBreakStrategyIOS; + std::string writingDirection; bool operator==(const MeasurementCacheKey &other) const { return std::tie(markdown, maxWidth, allowTrailingMargin, allowFontScaling, maxFontSizeMultiplier, md4cFlagsUnderline, md4cFlagsSuperscript, md4cFlagsSubscript, md4cFlagsHighlight, - md4cFlagsLatexMath, styleFingerprint, fontScale, flavor) == + md4cFlagsLatexMath, styleFingerprint, fontScale, flavor, lineBreakStrategyIOS, writingDirection) == std::tie(other.markdown, other.maxWidth, other.allowTrailingMargin, other.allowFontScaling, other.maxFontSizeMultiplier, other.md4cFlagsUnderline, other.md4cFlagsSuperscript, other.md4cFlagsSubscript, other.md4cFlagsHighlight, other.md4cFlagsLatexMath, - other.styleFingerprint, other.fontScale, other.flavor); + other.styleFingerprint, other.fontScale, other.flavor, other.lineBreakStrategyIOS, + other.writingDirection); } }; @@ -73,6 +76,8 @@ struct MeasurementCacheKeyHash { HashUtils::hash_one(h, key.styleFingerprint); HashUtils::hash_one(h, key.fontScale); HashUtils::hash_one(h, static_cast(key.flavor)); + HashUtils::hash_one(h, key.lineBreakStrategyIOS); + HashUtils::hash_one(h, key.writingDirection); return h; } }; @@ -154,6 +159,8 @@ inline MeasurementCacheKey buildMeasurementCacheKey(const PropsType &props, CGFl .styleFingerprint = computeStyleFingerprint(props.markdownStyle), .fontScale = fontScale, .flavor = flavor, + .lineBreakStrategyIOS = props.lineBreakStrategyIOS, + .writingDirection = props.writingDirection, }; }