From b3465e9853780694c8376fd6158e508c9a5b257b Mon Sep 17 00:00:00 2001 From: routersys Date: Sun, 11 Oct 2026 22:14:31 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E5=BF=83=E3=81=8C=E7=AF=84=E5=9B=B2?= =?UTF-8?q?=E3=81=AE=E5=A4=96=E3=81=AB=E3=81=82=E3=82=8B=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AE=E4=BD=99=E7=99=BD=E3=81=AE=E8=A9=A6=E9=A8=93=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShiftGeometryTests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SpectrumColorShift.Tests/ShiftGeometryTests.cs b/SpectrumColorShift.Tests/ShiftGeometryTests.cs index c60ea8f..fde0ce4 100644 --- a/SpectrumColorShift.Tests/ShiftGeometryTests.cs +++ b/SpectrumColorShift.Tests/ShiftGeometryTests.cs @@ -115,6 +115,17 @@ public sealed class ShiftGeometryTests Assert.Equal(new RawRect(-12, -2, 72, 42), output); } + [Theory] + [InlineData(-31f, 10f, 50f, -13, -12, 113, 32)] + [InlineData(80f, 10f, 50f, -82, -12, 56, 32)] + [InlineData(-31f, 10f, 25f, -9, -6, 66, 26)] + public void ARadialShiftAboutACenterOutsideTheBoundsZoomsTowardsAndAwayFromIt(float centerX, float centerY, float distance, int left, int top, int right, int bottom) + { + var output = ShiftGeometry.Output(new RawRect(0, 0, 40, 20), ShiftMode.Radial, distance, Horizontal, new Vector2(centerX, centerY), 100f); + + Assert.Equal(new RawRect(left, top, right, bottom), output); + } + [Fact] public void ARadialShiftOfAMatchingRadiusZoomsTheBoundsOfARealImage() { @@ -183,6 +194,14 @@ public sealed class ShiftGeometryTests Assert.Equal(new RawRect(-17, -12, 57, 32), input); } + [Fact] + public void TheRadialInputGrowsEachAxisByTheTravelFromACenterOffOnBothAxes() + { + var input = ShiftGeometry.Input(new RawRect(0, 0, 40, 20), ShiftMode.Radial, 50f, Horizontal, new Vector2(10f, 15f), 100f); + + Assert.Equal(new RawRect(-17, -10, 57, 30), input); + } + [Theory] [InlineData(10f, -60, -60, 60, 60)] [InlineData(100000f, -194, -194, 194, 194)]