mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 14:05:09 +00:00
Add Windows support (#1632)
Adds Windows support. Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com> Co-authored-by: REDMOND\agnel <agnel@microsoft.com>
This commit is contained in:
committed by
Wojciech Lewicki
parent
4d3c521a22
commit
28d51bdf06
34
windows/RNSVG/ImageViewManager.cpp
Normal file
34
windows/RNSVG/ImageViewManager.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "pch.h"
|
||||
#include "ImageViewManager.h"
|
||||
#include "ImageViewManager.g.cpp"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace Microsoft::ReactNative;
|
||||
|
||||
namespace winrt::RNSVG::implementation {
|
||||
ImageViewManager::ImageViewManager() {
|
||||
m_class = RNSVG::SVGClass::RNSVGImage;
|
||||
m_name = L"RNSVGImage";
|
||||
}
|
||||
|
||||
IMapView<hstring, ViewManagerPropertyType> ImageViewManager::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"x", ViewManagerPropertyType::String);
|
||||
nativeProps.Insert(L"y", ViewManagerPropertyType::String);
|
||||
nativeProps.Insert(L"height", ViewManagerPropertyType::String);
|
||||
nativeProps.Insert(L"width", ViewManagerPropertyType::String);
|
||||
nativeProps.Insert(L"src", ViewManagerPropertyType::String);
|
||||
|
||||
// preserveAspectRatio
|
||||
nativeProps.Insert(L"align", ViewManagerPropertyType::String);
|
||||
nativeProps.Insert(L"meetOrSlice", ViewManagerPropertyType::Number);
|
||||
|
||||
return nativeProps.GetView();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user