Skip to content

Commit

Permalink
Fabric: simplify border code, and fix some border issues (#10659)
Browse files Browse the repository at this point in the history
* Fabric: fix zorder issues

* Change files

* Fabric: simplify border code, and fix some border issues

* change file

* rename const

* format
  • Loading branch information
acoates-ms committed Sep 30, 2022
1 parent b6a91f6 commit d6dd444
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 130 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Fabric: simplify border code, and fix some border issues",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions vnext/Microsoft.ReactNative/CompositionSwitcher.idl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace Microsoft.ReactNative.Composition
void Size(Windows.Foundation.Numerics.Vector2 size);
void Offset(Windows.Foundation.Numerics.Vector3 offset);
void Offset(Windows.Foundation.Numerics.Vector3 offset, Windows.Foundation.Numerics.Vector3 relativeAdjustment);
void RelativeSizeWithOffset(Windows.Foundation.Numerics.Vector2 size, Windows.Foundation.Numerics.Vector2 relativeSizeAdjustment);
}

[webhosthidden]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ struct CompVisual : public winrt::implements<
m_visual.RelativeOffsetAdjustment(relativeAdjustment);
}

void RelativeSizeWithOffset(
winrt::Windows::Foundation::Numerics::float2 size,
winrt::Windows::Foundation::Numerics::float2 relativeSizeAdjustment) noexcept {
m_visual.Size(size);
m_visual.RelativeSizeAdjustment(relativeSizeAdjustment);
}

private:
winrt::Windows::UI::Composition::Visual m_visual;
};
Expand Down Expand Up @@ -305,6 +312,13 @@ struct CompSpriteVisual : winrt::Microsoft::ReactNative::Composition::implementa
m_visual.RelativeOffsetAdjustment(relativeAdjustment);
}

void RelativeSizeWithOffset(
winrt::Windows::Foundation::Numerics::float2 size,
winrt::Windows::Foundation::Numerics::float2 relativeSizeAdjustment) noexcept {
m_visual.Size(size);
m_visual.RelativeSizeAdjustment(relativeSizeAdjustment);
}

void SetClippingPath(ID2D1Geometry *clippingPath) noexcept {
if (!clippingPath) {
m_visual.Clip(nullptr);
Expand Down Expand Up @@ -478,6 +492,13 @@ struct CompScrollerVisual : winrt::Microsoft::ReactNative::Composition::implemen
m_visual.RelativeOffsetAdjustment(relativeAdjustment);
}

void RelativeSizeWithOffset(
winrt::Windows::Foundation::Numerics::float2 size,
winrt::Windows::Foundation::Numerics::float2 relativeSizeAdjustment) noexcept {
m_visual.Size(size);
m_visual.RelativeSizeAdjustment(relativeSizeAdjustment);
}

void SetClippingPath(ID2D1Geometry *clippingPath) noexcept {
auto geometry = winrt::make<GeometrySource>(clippingPath);
auto path = winrt::Windows::UI::Composition::CompositionPath(geometry);
Expand Down

0 comments on commit d6dd444

Please sign in to comment.