mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
# Summary "mask-type: alpha" is not supported. resolve issue: #1790 ## Explanation svg example: ``` <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" fill="none"> <g clip-path="url(#clip0_8_3)"> <rect width="100" height="100" fill="white"/> <mask id="mask0_8_3" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"> <circle cx="50" cy="50" r="50" fill="#000000"/> </mask> <g mask="url(#mask0_8_3)"> <rect x="-26" y="-78" width="209" height="263" fill="#252E74"/> </g> </g> <defs> <clipPath id="clip0_8_3"> <rect width="100" height="100" fill="white"/> </clipPath> </defs> </svg> ``` Current behavior:  Expected behavior:  ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | Android | ✅ | ## Checklist <!-- Check completed item, when applicable, via: [X] --> - [x] I have tested this on a device and a simulator - [ ] I added documentation in `README.md` - [x] I updated the typed files (typescript) - [ ] I added a test for the API in the `__tests__` folder --------- Co-authored-by: Sergey <s.yurkevich@logiclike.com> Co-authored-by: Jakub Grzywacz <jakub.grzywacz@swmansion.com>
36 lines
815 B
Plaintext
36 lines
815 B
Plaintext
/**
|
|
* Copyright (c) 2015-present, Horcrux.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the MIT-style license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RNSVGMaskManager.h"
|
|
#import "RNSVGMask.h"
|
|
|
|
@implementation RNSVGMaskManager
|
|
|
|
RCT_EXPORT_MODULE()
|
|
|
|
- (RNSVGMask *)node
|
|
{
|
|
return [RNSVGMask new];
|
|
}
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(x, RNSVGLength *)
|
|
RCT_EXPORT_VIEW_PROPERTY(y, RNSVGLength *)
|
|
RCT_CUSTOM_VIEW_PROPERTY(height, id, RNSVGMask)
|
|
{
|
|
view.maskheight = [RCTConvert RNSVGLength:json];
|
|
}
|
|
RCT_CUSTOM_VIEW_PROPERTY(width, id, RNSVGMask)
|
|
{
|
|
view.maskwidth = [RCTConvert RNSVGLength:json];
|
|
}
|
|
RCT_EXPORT_VIEW_PROPERTY(maskUnits, RNSVGUnits)
|
|
RCT_EXPORT_VIEW_PROPERTY(maskContentUnits, RNSVGUnits)
|
|
RCT_EXPORT_VIEW_PROPERTY(maskType, RNSVGMaskType)
|
|
|
|
@end
|