@react-native-ohos/react-native-clippathview 1.1.9-rc.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/harmony/clipPath/BuildProfile.ets +6 -0
- package/harmony/clipPath/OAT.xml +39 -0
- package/harmony/clipPath/README.OpenSource +11 -0
- package/harmony/clipPath/index.ets +0 -2
- package/harmony/clipPath/oh-package.json5 +1 -1
- package/harmony/clipPath/src/main/cpp/ClipPathProps.h +63 -120
- package/harmony/clipPath/src/main/cpp/ClipPathViewComponentInstance.cpp +37 -43
- package/harmony/clipPath/src/main/cpp/ClipPathViewComponentInstance.h +1 -6
- package/harmony/clipPath/src/main/cpp/ClipPathViewNoneComponentInstance.cpp +36 -43
- package/harmony/clipPath/src/main/cpp/ClipPathViewNoneNode.cpp +90 -166
- package/harmony/clipPath/src/main/cpp/ClipPathViewNoneNode.h +84 -100
- package/harmony/clipPath/src/main/cpp/RNCClipPathTurboModule.cpp +2 -2
- package/harmony/clipPath/src/main/cpp/RNCClipPathTurboModule.h +7 -10
- package/harmony/clipPath/src/main/cpp/SVGPathParser.cpp +222 -261
- package/harmony/clipPath/src/main/cpp/SVGPathParser.h +4 -4
- package/harmony/clipPath/src/main/cpp/SVGViewBox.cpp +9 -9
- package/harmony/clipPath/src/main/cpp/ShadowNodes.cpp +2 -4
- package/harmony/clipPath/src/main/cpp/pen_style_node.h +4 -20
- package/harmony/clipPath/src/main/ets/{ClipPathPackage.ets → ClipPathPackage.ts} +1 -2
- package/harmony/clipPath.har +0 -0
- package/package.json +6 -12
- package/react-native-clippath.podspec +30 -0
- /package/harmony/clipPath/{ts.ets → ts.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @react-native-ohos/react-native-clippathview
|
|
2
2
|
|
|
3
|
-
This project is based on [react-native-clippathview](https://github.com/Only-IceSoul/react-native-clippath)
|
|
3
|
+
This project is based on [react-native-clippathview v1.1.8](https://github.com/Only-IceSoul/react-native-clippath)
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
|
-
[中文](https://
|
|
7
|
+
[中文](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/zh-cn/react-native-clippath-capi.md)
|
|
8
8
|
|
|
9
|
-
[English](https://
|
|
9
|
+
[English](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/en/react-native-clippath-capi.md)
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
## License
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<configuration>
|
|
3
|
+
<oatconfig>
|
|
4
|
+
<licensefile>LICENSE</licensefile>
|
|
5
|
+
<filefilterlist>
|
|
6
|
+
<filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
7
|
+
<filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加版权头"/>
|
|
8
|
+
<filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加版权头"/>
|
|
9
|
+
<filteritem type="filename" name="*.proto" desc="资源文件,不需要添加版权头"/>
|
|
10
|
+
<filteritem type="filename" name="*.json" desc="资源文件,不需要添加版权头"/>
|
|
11
|
+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
12
|
+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
13
|
+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
14
|
+
<filteritem type="filename" name="LICENSE" desc="工程文件,不修改版权头"/>
|
|
15
|
+
</filefilter>
|
|
16
|
+
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
17
|
+
<filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加许可证头"/>
|
|
18
|
+
<filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加许可证头"/>
|
|
19
|
+
<filteritem type="filename" name="LICENSE" desc="原三方库证书文件无需更改,因此添加过滤"/>
|
|
20
|
+
<filteritem type="filename" name="*.proto" desc="资源文件,不需要添加许可证头"/>
|
|
21
|
+
<filteritem type="filename" name="*.json" desc="资源文件,不需要添加许可证头"/>
|
|
22
|
+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
23
|
+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
24
|
+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
25
|
+
</filefilter>
|
|
26
|
+
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for resources files policies">
|
|
27
|
+
<filteritem type="filename" name="icon.png" desc="应用图标"/>
|
|
28
|
+
<filteritem type="filename" name="app_icon.png" desc="应用图标"/>
|
|
29
|
+
<filteritem type="filename" name="warn.png" desc="页面展示图标"/>
|
|
30
|
+
<filteritem type="filename" name="*.png" desc="展示图标"/>
|
|
31
|
+
</filefilter>
|
|
32
|
+
</filefilterlist>
|
|
33
|
+
<policylist>
|
|
34
|
+
<policy name="projectPolicy" desc="">
|
|
35
|
+
<policyitem type="license" name="Apache" path="src/.*" desc="license under the Apache"/>
|
|
36
|
+
</policy>
|
|
37
|
+
</policylist>
|
|
38
|
+
</oatconfig>
|
|
39
|
+
</configuration>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"Name": "react-native-clippath",
|
|
4
|
+
"License": "MIT License",
|
|
5
|
+
"License File": "https://github.com/Only-IceSoul/react-native-clippath/blob/main/LICENSE",
|
|
6
|
+
"Version Number": "1.1.8",
|
|
7
|
+
"Owner" : "Only-IceSoul"
|
|
8
|
+
"Upstream URL": "https://github.com/Only-IceSoul/react-native-clippath",
|
|
9
|
+
"Description": "ClipPath - Hardware accelerated"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"name": "@react-native-ohos/react-native-clippathview",
|
|
7
7
|
"description": "Please describe the basic information.",
|
|
8
8
|
"main": "index.ets",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.2.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@rnoh/react-native-openharmony": "file:../react_native_openharmony"
|
|
12
12
|
},
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* you may not use this file except in compliance with the License.
|
|
5
|
-
* You may obtain a copy of the License at
|
|
6
|
-
*
|
|
7
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
* See the License for the specific language governing permissions and
|
|
13
|
-
* limitations under the License.
|
|
14
|
-
*/
|
|
1
|
+
//
|
|
2
|
+
// Created on 2024/6/27.
|
|
3
|
+
//
|
|
15
4
|
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
|
|
16
5
|
// please include "napi/native_api.h".
|
|
17
|
-
#ifndef CLIPPATHPROPS_H
|
|
18
|
-
#define CLIPPATHPROPS_H
|
|
19
6
|
|
|
20
7
|
#pragma once
|
|
21
8
|
#include "ModUtil.h"
|
|
@@ -25,129 +12,87 @@
|
|
|
25
12
|
namespace rnoh {
|
|
26
13
|
class ClipPathProps {
|
|
27
14
|
public:
|
|
28
|
-
float mOpacity{
|
|
29
|
-
bool mOpacityStatus{
|
|
30
|
-
std::string mMask{
|
|
31
|
-
std::string mOldMask{
|
|
32
|
-
bool mFillColorStatus{
|
|
33
|
-
float mFillOpacity{
|
|
34
|
-
bool mFillOpacityStatus{
|
|
35
|
-
std::string mFillRule{
|
|
36
|
-
bool mFillRuleStatus{
|
|
37
|
-
bool mStrokeColorStatus{
|
|
38
|
-
float mStrokeOpacity{
|
|
39
|
-
bool mStrokeOpacityStatus{
|
|
40
|
-
float mStrokeWidth{
|
|
41
|
-
bool mStrokeWidthStatus{
|
|
42
|
-
std::string mStrokeCap{
|
|
43
|
-
std::string mStrokeJoin{
|
|
44
|
-
float mStrokeMiter{
|
|
45
|
-
bool mStrokeMiterStatus{
|
|
46
|
-
float mStrokeStart{
|
|
47
|
-
bool mStrokeStartStatus{
|
|
48
|
-
float mStrokeEnd{
|
|
49
|
-
bool mStrokeEndStatus{
|
|
50
|
-
bool mShadowColorStatus{
|
|
51
|
-
float mShadowOpacity{
|
|
52
|
-
bool mShadowOpacityStatus{
|
|
53
|
-
float mShadowRadius{
|
|
54
|
-
bool mShadowRadiusStatus{
|
|
55
|
-
float mShadowOffsetX{
|
|
56
|
-
float mShadowOffsetY{
|
|
57
|
-
bool mShadowOffsetIsPercent{
|
|
58
|
-
bool mShadowOffsetStatus{
|
|
15
|
+
float mOpacity{1.0f};
|
|
16
|
+
bool mOpacityStatus{false};
|
|
17
|
+
std::string mMask{""};
|
|
18
|
+
std::string mOldMask{""};
|
|
19
|
+
bool mFillColorStatus{false};
|
|
20
|
+
float mFillOpacity{1.0f};
|
|
21
|
+
bool mFillOpacityStatus{false};
|
|
22
|
+
std::string mFillRule{"none"};
|
|
23
|
+
bool mFillRuleStatus{false};
|
|
24
|
+
bool mStrokeColorStatus{false};
|
|
25
|
+
float mStrokeOpacity{1.0f};
|
|
26
|
+
bool mStrokeOpacityStatus{false};
|
|
27
|
+
float mStrokeWidth{1.0f};
|
|
28
|
+
bool mStrokeWidthStatus{false};
|
|
29
|
+
std::string mStrokeCap{"none"};
|
|
30
|
+
std::string mStrokeJoin{"none"};
|
|
31
|
+
float mStrokeMiter{4.0f};
|
|
32
|
+
bool mStrokeMiterStatus{false};
|
|
33
|
+
float mStrokeStart{0.0f};
|
|
34
|
+
bool mStrokeStartStatus{false};
|
|
35
|
+
float mStrokeEnd{1.0f};
|
|
36
|
+
bool mStrokeEndStatus{false};
|
|
37
|
+
bool mShadowColorStatus{false};
|
|
38
|
+
float mShadowOpacity{0.0f};
|
|
39
|
+
bool mShadowOpacityStatus{false};
|
|
40
|
+
float mShadowRadius{2.0f};
|
|
41
|
+
bool mShadowRadiusStatus{false};
|
|
42
|
+
float mShadowOffsetX{2.0f};
|
|
43
|
+
float mShadowOffsetY{2.0f};
|
|
44
|
+
bool mShadowOffsetIsPercent{false};
|
|
45
|
+
bool mShadowOffsetStatus{false};
|
|
59
46
|
|
|
60
47
|
public:
|
|
61
|
-
float getOpacity()
|
|
62
|
-
{
|
|
63
|
-
return ModUtil::clamp(mOpacity);
|
|
64
|
-
}
|
|
48
|
+
float getOpacity() { return ModUtil::clamp(mOpacity); }
|
|
65
49
|
|
|
66
|
-
std::string getMask()
|
|
67
|
-
{
|
|
68
|
-
return mMask;
|
|
69
|
-
}
|
|
50
|
+
std::string getMask() { return mMask; }
|
|
70
51
|
|
|
71
|
-
float getFillOpacity()
|
|
72
|
-
{
|
|
73
|
-
return ModUtil::clamp(mFillOpacity);
|
|
74
|
-
}
|
|
52
|
+
float getFillOpacity() { return ModUtil::clamp(mFillOpacity); }
|
|
75
53
|
|
|
76
|
-
OH_Drawing_PathFillType getFillRule()
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
OH_Drawing_PathFillType::PATH_FILL_TYPE_WINDING;
|
|
54
|
+
OH_Drawing_PathFillType getFillRule() {
|
|
55
|
+
return mFillRule.compare("evenodd") == 0 ? OH_Drawing_PathFillType::PATH_FILL_TYPE_EVEN_ODD
|
|
56
|
+
: OH_Drawing_PathFillType::PATH_FILL_TYPE_WINDING;
|
|
80
57
|
}
|
|
81
58
|
|
|
82
59
|
|
|
83
|
-
float getStrokeOpacity()
|
|
84
|
-
{
|
|
85
|
-
return ModUtil::clamp(mStrokeOpacity);
|
|
86
|
-
}
|
|
60
|
+
float getStrokeOpacity() { return ModUtil::clamp(mStrokeOpacity); }
|
|
87
61
|
|
|
88
|
-
float getStrokeWidth()
|
|
89
|
-
{
|
|
90
|
-
return ModUtil::uClamp(mStrokeWidth, 1.0f);
|
|
91
|
-
}
|
|
62
|
+
float getStrokeWidth() { return ModUtil::uClamp(mStrokeWidth, 1.0f); }
|
|
92
63
|
|
|
93
|
-
OH_Drawing_PenLineCapStyle getStrokeCap()
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
OH_Drawing_PenLineCapStyle::LINE_FLAT_CAP);
|
|
64
|
+
OH_Drawing_PenLineCapStyle getStrokeCap() {
|
|
65
|
+
return mStrokeCap.compare("round") == 0
|
|
66
|
+
? OH_Drawing_PenLineCapStyle::LINE_ROUND_CAP
|
|
67
|
+
: (mStrokeCap.compare("square") == 0 ? OH_Drawing_PenLineCapStyle::LINE_SQUARE_CAP
|
|
68
|
+
: OH_Drawing_PenLineCapStyle::LINE_FLAT_CAP);
|
|
99
69
|
}
|
|
100
|
-
OH_Drawing_PenLineJoinStyle getStrokeJoin()
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
OH_Drawing_PenLineJoinStyle::LINE_MITER_JOIN);
|
|
70
|
+
OH_Drawing_PenLineJoinStyle getStrokeJoin() {
|
|
71
|
+
return mStrokeJoin.compare("round") == 0
|
|
72
|
+
? OH_Drawing_PenLineJoinStyle::LINE_ROUND_JOIN
|
|
73
|
+
: (mStrokeJoin.compare("bevel") == 0 ? OH_Drawing_PenLineJoinStyle::LINE_BEVEL_JOIN
|
|
74
|
+
: OH_Drawing_PenLineJoinStyle::LINE_MITER_JOIN);
|
|
106
75
|
}
|
|
107
76
|
|
|
108
|
-
float getStrokeMiter()
|
|
109
|
-
{
|
|
110
|
-
return mStrokeMiter;
|
|
111
|
-
}
|
|
77
|
+
float getStrokeMiter() { return mStrokeMiter; }
|
|
112
78
|
|
|
113
|
-
float getStrokeStart()
|
|
114
|
-
{
|
|
115
|
-
return ModUtil::clamp(mStrokeStart);
|
|
116
|
-
}
|
|
79
|
+
float getStrokeStart() { return ModUtil::clamp(mStrokeStart); }
|
|
117
80
|
|
|
118
|
-
float getStrokeEnd()
|
|
119
|
-
{
|
|
120
|
-
return ModUtil::clamp(mStrokeEnd);
|
|
121
|
-
}
|
|
81
|
+
float getStrokeEnd() { return ModUtil::clamp(mStrokeEnd); }
|
|
122
82
|
|
|
123
83
|
|
|
124
|
-
float getShadowOpacity()
|
|
125
|
-
{
|
|
126
|
-
return ModUtil::clamp(mShadowOpacity);
|
|
127
|
-
}
|
|
84
|
+
float getShadowOpacity() { return ModUtil::clamp(mShadowOpacity); }
|
|
128
85
|
|
|
129
|
-
float getShadowRadius()
|
|
130
|
-
{
|
|
131
|
-
return ModUtil::uClamp(mShadowRadius);
|
|
132
|
-
}
|
|
86
|
+
float getShadowRadius() { return ModUtil::uClamp(mShadowRadius); }
|
|
133
87
|
|
|
134
|
-
float getShadowOffsetX()
|
|
135
|
-
{
|
|
136
|
-
return mShadowOffsetX;
|
|
137
|
-
}
|
|
88
|
+
float getShadowOffsetX() { return mShadowOffsetX; }
|
|
138
89
|
|
|
139
|
-
float getShadowOffsetY()
|
|
140
|
-
{
|
|
141
|
-
return mShadowOffsetY;
|
|
142
|
-
}
|
|
90
|
+
float getShadowOffsetY() { return mShadowOffsetY; }
|
|
143
91
|
|
|
144
|
-
bool getShadowOffsetIsPercent()
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
92
|
+
bool getShadowOffsetIsPercent() { return mShadowOffsetIsPercent; }
|
|
93
|
+
|
|
94
|
+
void set(ClipPathProps props) {
|
|
148
95
|
|
|
149
|
-
void set(ClipPathProps props)
|
|
150
|
-
{
|
|
151
96
|
if (!mOpacityStatus)
|
|
152
97
|
mOpacity = props.mOpacity;
|
|
153
98
|
if (!mFillOpacityStatus)
|
|
@@ -179,6 +124,4 @@ public:
|
|
|
179
124
|
}
|
|
180
125
|
}
|
|
181
126
|
};
|
|
182
|
-
} // namespace rnoh
|
|
183
|
-
|
|
184
|
-
#endif
|
|
127
|
+
} // namespace rnoh
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* you may not use this file except in compliance with the License.
|
|
5
5
|
* You may obtain a copy of the License at
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
*
|
|
9
9
|
* Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
#include <glog/logging.h>
|
|
19
19
|
|
|
20
20
|
namespace rnoh {
|
|
21
|
-
ClipPathViewComponentInstance::ClipPathViewComponentInstance(Context context)
|
|
22
|
-
{
|
|
21
|
+
ClipPathViewComponentInstance::ClipPathViewComponentInstance(Context context)
|
|
22
|
+
: CppComponentInstance(std::move(context)) {
|
|
23
23
|
auto rnInstancePtr = this->m_deps->rnInstance.lock();
|
|
24
24
|
if (rnInstancePtr != nullptr) {
|
|
25
25
|
auto turboModule = rnInstancePtr->getTurboModule("RNCClipPathContext");
|
|
@@ -28,81 +28,75 @@ ClipPathViewComponentInstance::ClipPathViewComponentInstance(Context context) :
|
|
|
28
28
|
ModUtil::setDensity(static_cast<float>(result.asDouble()));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
void ClipPathViewComponentInstance::onChildInserted(ComponentInstance::Shared const &
|
|
32
|
-
|
|
33
|
-
{
|
|
31
|
+
void ClipPathViewComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
|
|
32
|
+
std::size_t index) {
|
|
34
33
|
CppComponentInstance::onChildInserted(childComponentInstance, index);
|
|
35
|
-
mClipPathNode.
|
|
34
|
+
mClipPathNode.insertChild(childComponentInstance->getLocalRootArkUINode(), index);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
void ClipPathViewComponentInstance::onChildRemoved(ComponentInstance::Shared const &
|
|
39
|
-
{
|
|
37
|
+
void ClipPathViewComponentInstance::onChildRemoved(ComponentInstance::Shared const &childComponentInstance) {
|
|
40
38
|
CppComponentInstance::onChildRemoved(childComponentInstance);
|
|
41
|
-
mClipPathNode.
|
|
39
|
+
mClipPathNode.removeChild(childComponentInstance->getLocalRootArkUINode());
|
|
42
40
|
};
|
|
43
41
|
|
|
44
|
-
ClipPathViewNoneNode &ClipPathViewComponentInstance::getLocalRootArkUINode()
|
|
45
|
-
{
|
|
46
|
-
return mClipPathNode;
|
|
47
|
-
}
|
|
42
|
+
ClipPathViewNoneNode &ClipPathViewComponentInstance::getLocalRootArkUINode() { return mClipPathNode; }
|
|
48
43
|
|
|
49
|
-
void ClipPathViewComponentInstance::onPropsChanged(SharedConcreteProps const &
|
|
50
|
-
{
|
|
44
|
+
void ClipPathViewComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
51
45
|
CppComponentInstance::onPropsChanged(props);
|
|
52
46
|
if (auto p = std::dynamic_pointer_cast<const facebook::react::RNCClipPathViewProps>(props)) {
|
|
53
|
-
mClipPathNode.
|
|
54
|
-
mClipPathNode.
|
|
47
|
+
mClipPathNode.setD(p->d);
|
|
48
|
+
mClipPathNode.setViewBox(p->viewBox);
|
|
55
49
|
if (p->translateZ != 0) {
|
|
56
|
-
mClipPathNode.
|
|
50
|
+
mClipPathNode.setTranslateZ(p->translateZ);
|
|
57
51
|
}
|
|
58
|
-
mClipPathNode.
|
|
59
|
-
mClipPathNode.
|
|
52
|
+
mClipPathNode.setAlign(p->align);
|
|
53
|
+
mClipPathNode.setAspect(p->aspect);
|
|
60
54
|
|
|
61
|
-
mClipPathNode.
|
|
62
|
-
mClipPathNode.
|
|
63
|
-
mClipPathNode.
|
|
64
|
-
mClipPathNode.
|
|
65
|
-
mClipPathNode.
|
|
66
|
-
mClipPathNode.
|
|
67
|
-
mClipPathNode.
|
|
55
|
+
mClipPathNode.setStrokeCap(p->strokeCap);
|
|
56
|
+
mClipPathNode.setStrokeJoin(p->strokeJoin);
|
|
57
|
+
mClipPathNode.setStrokeWidth(p->strokeWidth);
|
|
58
|
+
mClipPathNode.setStrokeMiter(p->strokeMiter);
|
|
59
|
+
mClipPathNode.setStrokeStart(p->strokeStart);
|
|
60
|
+
mClipPathNode.setStrokeEnd(p->strokeEnd);
|
|
61
|
+
mClipPathNode.setFillRule(p->fillRule);
|
|
68
62
|
if (p->rot != 0.0f) {
|
|
69
|
-
mClipPathNode.
|
|
63
|
+
mClipPathNode.setRot(p->rot);
|
|
70
64
|
}
|
|
71
65
|
if (p->rotO != 0.0f) {
|
|
72
|
-
mClipPathNode.
|
|
66
|
+
mClipPathNode.setRotO(p->rotO);
|
|
73
67
|
}
|
|
74
68
|
if (p->rotOx != 0.0f) {
|
|
75
|
-
mClipPathNode.
|
|
69
|
+
mClipPathNode.setRotOx(p->rotOx);
|
|
76
70
|
}
|
|
77
71
|
if (p->rotOy != 0.0f) {
|
|
78
|
-
mClipPathNode.
|
|
72
|
+
mClipPathNode.setRotOy(p->rotOy);
|
|
79
73
|
}
|
|
80
74
|
|
|
81
|
-
mClipPathNode.
|
|
75
|
+
mClipPathNode.setRotPercentageValue(p->rotPercentageValue);
|
|
82
76
|
if (p->sc != 1.0f) {
|
|
83
|
-
mClipPathNode.
|
|
77
|
+
mClipPathNode.setSc(p->sc);
|
|
84
78
|
}
|
|
85
79
|
if (p->scX != 1.0f) {
|
|
86
|
-
mClipPathNode.
|
|
80
|
+
mClipPathNode.setScX(p->scX);
|
|
87
81
|
}
|
|
88
82
|
if (p->scY != 1.0f) {
|
|
89
|
-
mClipPathNode.
|
|
83
|
+
mClipPathNode.setScY(p->scY);
|
|
90
84
|
}
|
|
91
85
|
|
|
92
86
|
if (p->scO != 0.0f) {
|
|
93
|
-
mClipPathNode.
|
|
87
|
+
mClipPathNode.setScO(p->scO);
|
|
94
88
|
}
|
|
95
89
|
if (p->scOx != 0.0f) {
|
|
96
|
-
mClipPathNode.
|
|
90
|
+
mClipPathNode.setScOx(p->scOx);
|
|
97
91
|
}
|
|
98
92
|
if (p->scOy != 0.0f) {
|
|
99
|
-
mClipPathNode.
|
|
93
|
+
mClipPathNode.setScOy(p->scOy);
|
|
100
94
|
}
|
|
101
|
-
mClipPathNode.
|
|
95
|
+
mClipPathNode.setScPercentageValue(p->scPercentageValue);
|
|
102
96
|
|
|
103
|
-
mClipPathNode.
|
|
104
|
-
mClipPathNode.
|
|
105
|
-
mClipPathNode.
|
|
97
|
+
mClipPathNode.setTransX(p->transX);
|
|
98
|
+
mClipPathNode.setTransY(p->transY);
|
|
99
|
+
mClipPathNode.setTransPercentageValue(p->transPercentageValue);
|
|
106
100
|
}
|
|
107
101
|
}
|
|
108
102
|
} // namespace rnoh
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
#ifndef CLIPPATHVIEWCOMPONENTINSTANCE_H
|
|
17
|
-
#define CLIPPATHVIEWCOMPONENTINSTANCE_H
|
|
18
|
-
|
|
19
16
|
#include "ClipPathViewNoneNode.h"
|
|
20
17
|
#include "RNOH/CppComponentInstance.h"
|
|
21
18
|
#include "ShadowNodes.h"
|
|
@@ -33,6 +30,4 @@ public:
|
|
|
33
30
|
ClipPathViewNoneNode &getLocalRootArkUINode() override;
|
|
34
31
|
void onPropsChanged(SharedConcreteProps const &props) override;
|
|
35
32
|
};
|
|
36
|
-
} // namespace rnoh
|
|
37
|
-
|
|
38
|
-
#endif
|
|
33
|
+
} // namespace rnoh
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* you may not use this file except in compliance with the License.
|
|
5
5
|
* You may obtain a copy of the License at
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
8
|
*
|
|
9
9
|
* Unless required by applicable law or agreed to in writing, software
|
|
10
10
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
#include <glog/logging.h>
|
|
19
19
|
namespace rnoh {
|
|
20
20
|
ClipPathViewNoneComponentInstance::ClipPathViewNoneComponentInstance(Context context)
|
|
21
|
-
: CppComponentInstance(std::move(context))
|
|
22
|
-
{
|
|
21
|
+
: CppComponentInstance(std::move(context)) {
|
|
23
22
|
auto rnInstancePtr = this->m_deps->rnInstance.lock();
|
|
24
23
|
if (rnInstancePtr != nullptr) {
|
|
25
24
|
auto turboModule = rnInstancePtr->getTurboModule("RNCClipPathContext");
|
|
@@ -28,82 +27,76 @@ ClipPathViewNoneComponentInstance::ClipPathViewNoneComponentInstance(Context con
|
|
|
28
27
|
ModUtil::setDensity(static_cast<float>(result.asDouble()));
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
void ClipPathViewNoneComponentInstance::onChildInserted(ComponentInstance::Shared const &
|
|
32
|
-
|
|
33
|
-
{
|
|
30
|
+
void ClipPathViewNoneComponentInstance::onChildInserted(ComponentInstance::Shared const &childComponentInstance,
|
|
31
|
+
std::size_t index) {
|
|
34
32
|
CppComponentInstance::onChildInserted(childComponentInstance, index);
|
|
35
|
-
mClipPathNode.
|
|
33
|
+
mClipPathNode.insertChild(childComponentInstance->getLocalRootArkUINode(), index);
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
void ClipPathViewNoneComponentInstance::onChildRemoved(ComponentInstance::Shared const &
|
|
39
|
-
{
|
|
36
|
+
void ClipPathViewNoneComponentInstance::onChildRemoved(ComponentInstance::Shared const &childComponentInstance) {
|
|
40
37
|
CppComponentInstance::onChildRemoved(childComponentInstance);
|
|
41
|
-
mClipPathNode.
|
|
38
|
+
mClipPathNode.removeChild(childComponentInstance->getLocalRootArkUINode());
|
|
42
39
|
};
|
|
43
40
|
|
|
44
|
-
ClipPathViewNoneNode &ClipPathViewNoneComponentInstance::getLocalRootArkUINode()
|
|
45
|
-
{
|
|
46
|
-
return mClipPathNode;
|
|
47
|
-
}
|
|
41
|
+
ClipPathViewNoneNode &ClipPathViewNoneComponentInstance::getLocalRootArkUINode() { return mClipPathNode; }
|
|
48
42
|
|
|
49
|
-
void ClipPathViewNoneComponentInstance::onPropsChanged(SharedConcreteProps const &
|
|
50
|
-
{
|
|
43
|
+
void ClipPathViewNoneComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
51
44
|
CppComponentInstance::onPropsChanged(props);
|
|
52
45
|
if (auto p = std::dynamic_pointer_cast<const facebook::react::RNCClipPathViewNoneProps>(props)) {
|
|
53
|
-
mClipPathNode.
|
|
54
|
-
mClipPathNode.
|
|
46
|
+
mClipPathNode.setD(p->d);
|
|
47
|
+
mClipPathNode.setViewBox(p->viewBox);
|
|
55
48
|
if (p->translateZ != 0) {
|
|
56
|
-
mClipPathNode.
|
|
49
|
+
mClipPathNode.setTranslateZ(p->translateZ);
|
|
57
50
|
}
|
|
58
|
-
mClipPathNode.
|
|
59
|
-
mClipPathNode.
|
|
51
|
+
mClipPathNode.setAlign(p->align);
|
|
52
|
+
mClipPathNode.setAspect(p->aspect);
|
|
60
53
|
|
|
61
|
-
mClipPathNode.
|
|
62
|
-
mClipPathNode.
|
|
63
|
-
mClipPathNode.
|
|
64
|
-
mClipPathNode.
|
|
65
|
-
mClipPathNode.
|
|
66
|
-
mClipPathNode.
|
|
67
|
-
mClipPathNode.
|
|
54
|
+
mClipPathNode.setStrokeCap(p->strokeCap);
|
|
55
|
+
mClipPathNode.setStrokeJoin(p->strokeJoin);
|
|
56
|
+
mClipPathNode.setStrokeWidth(p->strokeWidth);
|
|
57
|
+
mClipPathNode.setStrokeMiter(p->strokeMiter);
|
|
58
|
+
mClipPathNode.setStrokeStart(p->strokeStart);
|
|
59
|
+
mClipPathNode.setStrokeEnd(p->strokeEnd);
|
|
60
|
+
mClipPathNode.setFillRule(p->fillRule);
|
|
68
61
|
|
|
69
62
|
if (p->rot != 0.0f) {
|
|
70
|
-
mClipPathNode.
|
|
63
|
+
mClipPathNode.setRot(p->rot);
|
|
71
64
|
}
|
|
72
65
|
if (p->rotO != 0.0f) {
|
|
73
|
-
mClipPathNode.
|
|
66
|
+
mClipPathNode.setRotO(p->rotO);
|
|
74
67
|
}
|
|
75
68
|
if (p->rotOx != 0.0f) {
|
|
76
|
-
mClipPathNode.
|
|
69
|
+
mClipPathNode.setRotOx(p->rotOx);
|
|
77
70
|
}
|
|
78
71
|
if (p->rotOy != 0.0f) {
|
|
79
|
-
mClipPathNode.
|
|
72
|
+
mClipPathNode.setRotOy(p->rotOy);
|
|
80
73
|
}
|
|
81
74
|
|
|
82
|
-
mClipPathNode.
|
|
75
|
+
mClipPathNode.setRotPercentageValue(p->rotPercentageValue);
|
|
83
76
|
if (p->sc != 1.0f) {
|
|
84
|
-
mClipPathNode.
|
|
77
|
+
mClipPathNode.setSc(p->sc);
|
|
85
78
|
}
|
|
86
79
|
if (p->scX != 1.0f) {
|
|
87
|
-
mClipPathNode.
|
|
80
|
+
mClipPathNode.setScX(p->scX);
|
|
88
81
|
}
|
|
89
82
|
if (p->scY != 1.0f) {
|
|
90
|
-
mClipPathNode.
|
|
83
|
+
mClipPathNode.setScY(p->scY);
|
|
91
84
|
}
|
|
92
85
|
|
|
93
86
|
if (p->scO != 0.0f) {
|
|
94
|
-
mClipPathNode.
|
|
87
|
+
mClipPathNode.setScO(p->scO);
|
|
95
88
|
}
|
|
96
89
|
if (p->scOx != 0.0f) {
|
|
97
|
-
mClipPathNode.
|
|
90
|
+
mClipPathNode.setScOx(p->scOx);
|
|
98
91
|
}
|
|
99
92
|
if (p->scOy != 0.0f) {
|
|
100
|
-
mClipPathNode.
|
|
93
|
+
mClipPathNode.setScOy(p->scOy);
|
|
101
94
|
}
|
|
102
|
-
mClipPathNode.
|
|
95
|
+
mClipPathNode.setScPercentageValue(p->scPercentageValue);
|
|
103
96
|
|
|
104
|
-
mClipPathNode.
|
|
105
|
-
mClipPathNode.
|
|
106
|
-
mClipPathNode.
|
|
97
|
+
mClipPathNode.setTransX(p->transX);
|
|
98
|
+
mClipPathNode.setTransY(p->transY);
|
|
99
|
+
mClipPathNode.setTransPercentageValue(p->transPercentageValue);
|
|
107
100
|
}
|
|
108
101
|
}
|
|
109
102
|
} // namespace rnoh
|