mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
# Summary This PR adds Fabric support and a FabricExample app for Windows. Windows support for Fabric is experimental and as such APIs are subject to change/break. ## Test Plan https://github.com/software-mansion/react-native-svg/assets/1422161/2a7db119-44a8-4ee1-a837-41ca8320d8fa ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ❌ | | Android | ❌ | | Windows | ✅ | ## Checklist - [x] I have tested this on a device and a simulator - [ ] I added documentation in `README.md` - [ ] I updated the typed files (typescript) - [ ] I added a test for the API in the `__tests__` folder
32 lines
982 B
C++
32 lines
982 B
C++
#include "pch.h"
|
|
#include "LineViewManager.h"
|
|
#if __has_include("LineViewManager.g.cpp")
|
|
#include "LineViewManager.g.cpp"
|
|
#endif
|
|
|
|
using namespace winrt;
|
|
using namespace Microsoft::ReactNative;
|
|
|
|
namespace winrt::RNSVG::implementation {
|
|
LineViewManager::LineViewManager() {
|
|
m_class = RNSVG::SVGClass::RNSVGLine;
|
|
m_name = L"RNSVGLine";
|
|
}
|
|
|
|
IMapView<hstring, ViewManagerPropertyType> LineViewManager::NativeProps() {
|
|
auto const &parentProps{__super::NativeProps()};
|
|
auto const &nativeProps{winrt::single_threaded_map<hstring, ViewManagerPropertyType>()};
|
|
|
|
for (auto const &prop : parentProps) {
|
|
nativeProps.Insert(prop.Key(), prop.Value());
|
|
}
|
|
|
|
nativeProps.Insert(L"x1", ViewManagerPropertyType::String);
|
|
nativeProps.Insert(L"y1", ViewManagerPropertyType::String);
|
|
nativeProps.Insert(L"x2", ViewManagerPropertyType::String);
|
|
nativeProps.Insert(L"y2", ViewManagerPropertyType::String);
|
|
|
|
return nativeProps.GetView();
|
|
}
|
|
} // namespace winrt::RNSVG::implementation
|