@@ -38,7 +38,7 @@ @implementation RCTShadowText
3838 CGFloat _cachedTextStorageWidthMode;
3939 NSAttributedString *_cachedAttributedString;
4040 CGFloat _effectiveLetterSpacing;
41- UIUserInterfaceLayoutDirection _cachedLayoutDirection ;
41+ UIUserInterfaceLayoutDirection _cachedEffectiveLayoutDirection ;
4242}
4343
4444static YGSize RCTMeasure (YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
@@ -72,7 +72,7 @@ - (instancetype)init
7272 _fontSizeMultiplier = 1.0 ;
7373 _textAlign = NSTextAlignmentNatural;
7474 _writingDirection = NSWritingDirectionNatural;
75- _cachedLayoutDirection = UIUserInterfaceLayoutDirectionLeftToRight;
75+ _cachedEffectiveLayoutDirection = UIUserInterfaceLayoutDirectionLeftToRight;
7676
7777 YGNodeSetMeasureFunc (self.yogaNode , RCTMeasure);
7878
@@ -198,7 +198,7 @@ - (NSTextStorage *)buildTextStorageForWidth:(CGFloat)width widthMode:(YGMeasureM
198198 _cachedTextStorage &&
199199 (width == _cachedTextStorageWidth || (isnan (width) && isnan (_cachedTextStorageWidth))) &&
200200 widthMode == _cachedTextStorageWidthMode &&
201- _cachedLayoutDirection == self.layoutDirection
201+ _cachedEffectiveLayoutDirection == self.effectiveLayoutDirection
202202 ) {
203203 return _cachedTextStorage;
204204 }
@@ -272,12 +272,12 @@ - (NSAttributedString *)_attributedStringWithFontFamily:(NSString *)fontFamily
272272 if (
273273 ![self isTextDirty ] &&
274274 _cachedAttributedString &&
275- _cachedLayoutDirection == self.layoutDirection
275+ _cachedEffectiveLayoutDirection == self.effectiveLayoutDirection
276276 ) {
277277 return _cachedAttributedString;
278278 }
279279
280- _cachedLayoutDirection = self.layoutDirection ;
280+ _cachedEffectiveLayoutDirection = self.effectiveLayoutDirection ;
281281
282282 if (_fontSize && !isnan (_fontSize)) {
283283 fontSize = @(_fontSize);
@@ -419,7 +419,7 @@ - (void)_setParagraphStyleOnAttributedString:(NSMutableAttributedString *)attrib
419419 // Text alignment
420420 NSTextAlignment textAlign = _textAlign;
421421 if (textAlign == NSTextAlignmentRight || textAlign == NSTextAlignmentLeft) {
422- if (_cachedLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
422+ if (_cachedEffectiveLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
423423 if (textAlign == NSTextAlignmentRight) {
424424 textAlign = NSTextAlignmentLeft;
425425 } else {
0 commit comments