mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
6b9e4ec4b2
Summary: public Added opacity property to RCTShadowText, and use it to adjust the alpha color component of nested text nodes when collapsing the RCTShadowText tree into an NSAttributedString. The opacity is propagated down the tree, multiplying the aggregate with the current node's opacity at each step. Also, foreground and background colors are propagated down the tree so that in case a node has an opacity style but no colors, the ancestor's colors can be used when adjusting the alpha components. Reviewed By: nicklockwood Differential Revision: D2600402 fb-gh-sync-id: 2adb7b598b0a73c984bb2edaab545c02ab911c6b
40 lines
1.5 KiB
Objective-C
40 lines
1.5 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import "RCTShadowView.h"
|
|
#import "RCTTextDecorationLineType.h"
|
|
|
|
extern NSString *const RCTIsHighlightedAttributeName;
|
|
extern NSString *const RCTReactTagAttributeName;
|
|
|
|
@interface RCTShadowText : RCTShadowView
|
|
|
|
@property (nonatomic, strong) UIColor *color;
|
|
@property (nonatomic, copy) NSString *fontFamily;
|
|
@property (nonatomic, assign) CGFloat fontSize;
|
|
@property (nonatomic, copy) NSString *fontWeight;
|
|
@property (nonatomic, copy) NSString *fontStyle;
|
|
@property (nonatomic, assign) BOOL isHighlighted;
|
|
@property (nonatomic, assign) CGFloat letterSpacing;
|
|
@property (nonatomic, assign) CGFloat lineHeight;
|
|
@property (nonatomic, assign) NSUInteger numberOfLines;
|
|
@property (nonatomic, assign) CGSize shadowOffset;
|
|
@property (nonatomic, assign) NSTextAlignment textAlign;
|
|
@property (nonatomic, assign) NSWritingDirection writingDirection;
|
|
@property (nonatomic, strong) UIColor *textDecorationColor;
|
|
@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle;
|
|
@property (nonatomic, assign) RCTTextDecorationLineType textDecorationLine;
|
|
@property (nonatomic, assign) CGFloat fontSizeMultiplier;
|
|
@property (nonatomic, assign) BOOL allowFontScaling;
|
|
@property (nonatomic, assign) CGFloat opacity;
|
|
|
|
- (void)recomputeText;
|
|
|
|
@end
|