Adds support to compile react-native-svg against WinAppSDK (#2255)

# Summary

Adds namespace redirects required to compile react-native-svg sources
against WinAppSDK for react-native-windows.

## Test Plan

There aren't a lot of examples for building react-native-windows apps in
open source targeting WinAppSDK, but we have some proprietary builds,
and this source code is working there (it is also still compatible with
UWP).
This commit is contained in:
Eric Rozell
2024-04-12 05:10:19 -04:00
committed by GitHub
parent 4b51a41a22
commit 9f6f6fd40c
14 changed files with 60 additions and 53 deletions

View File

@@ -13,8 +13,8 @@ struct RenderableView : RenderableViewT<RenderableView> {
RNSVG::SvgView SvgRoot();
Windows::UI::Xaml::FrameworkElement SvgParent() { return m_parent; }
void SvgParent(Windows::UI::Xaml::FrameworkElement const &value) { m_parent = value; }
xaml::FrameworkElement SvgParent() { return m_parent; }
void SvgParent(xaml::FrameworkElement const &value) { m_parent = value; }
RNSVG::D2DGeometry Geometry() { return m_geometry; }
void Geometry(RNSVG::D2DGeometry const &value) { m_geometry = value; }
@@ -71,7 +71,7 @@ struct RenderableView : RenderableViewT<RenderableView> {
private:
Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
Windows::UI::Xaml::FrameworkElement m_parent{nullptr};
xaml::FrameworkElement m_parent{nullptr};
RNSVG::D2DGeometry m_geometry{nullptr};
bool m_recreateResources{true};
bool m_isResponsible{false};
@@ -80,8 +80,8 @@ struct RenderableView : RenderableViewT<RenderableView> {
hstring m_id{L""};
hstring m_clipPathId{L""};
Numerics::float3x2 m_transformMatrix{Numerics::make_float3x2_rotation(0)};
Windows::UI::Color m_fill{Windows::UI::Colors::Black()};
Windows::UI::Color m_stroke{Windows::UI::Colors::Transparent()};
Windows::UI::Color m_fill{Colors::Black()};
Windows::UI::Color m_stroke{Colors::Transparent()};
hstring m_fillBrushId{L""};
hstring m_strokeBrushId{L""};
float m_fillOpacity{1.0f};