-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fixed GraphicsView drawable is visible outside the canvas #28353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 19 commits into
dotnet:inflight/current
from
NirmalKumarYuvaraj:fix-20834
Mar 30, 2026
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6f35b1f
Fixed andoird canvas drawing outside bounds
NirmalKumarYuvaraj a3b9a5b
Update PlatformGraphicsView.cs
NirmalKumarYuvaraj b8c366c
Updated test case files
NirmalKumarYuvaraj aa86b3f
Added ios snapshots
NirmalKumarYuvaraj cdb84e4
updated namespace
NirmalKumarYuvaraj 320bd36
Update Issue20834.cs
NirmalKumarYuvaraj 3b02832
Added MAC screen shots
NirmalKumarYuvaraj 2689c4e
updated test case
NirmalKumarYuvaraj e8b1505
Fixed andoird canvas drawing outside bounds
NirmalKumarYuvaraj 6f5ecf1
Update PlatformGraphicsView.cs
NirmalKumarYuvaraj 561a237
Updated test case files
NirmalKumarYuvaraj 653bd20
Added ios snapshots
NirmalKumarYuvaraj 33db509
Updated images
NirmalKumarYuvaraj 2716c4e
Updated Mac snapshots
NirmalKumarYuvaraj f3f6524
Use buttons to make windows work
mattleibow 95bfdf9
Modified test case
NirmalKumarYuvaraj 8be5238
removed older test files
NirmalKumarYuvaraj 67e7b72
added pending snap
NirmalKumarYuvaraj f1b48af
updated android image
NirmalKumarYuvaraj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+41.2 KB
...ndroid.Tests/snapshots/android/GraphicsViewShouldClipCirclesAtEdgePositions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
194 changes: 194 additions & 0 deletions
194
src/Controls/tests/TestCases.HostApp/Issues/Issue20834.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,194 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace Maui.Controls.Sample.Issues; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Issue(IssueTracker.Github, 20834, "[Android] GraphicsView can also be visible outside the canvas", PlatformAffected.Android)] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public class Issue20834 : TestContentPage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readonly Issue20834_Drawable drawable = new(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GraphicsView graphicsView; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Label overlayLabel; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| protected override void Init() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var rootLayout = new Grid() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RowDefinitions = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new RowDefinition() { Height = 300 }, // Canvas row | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new RowDefinition() { Height = 60 } // Button row | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // First row: Canvas with overlapping label | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var canvasGrid = new Grid() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BackgroundColor = Color.FromArgb("#1a2033"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HeightRequest = 300, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WidthRequest = 300, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HorizontalOptions = LayoutOptions.Center, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VerticalOptions = LayoutOptions.Center | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Create the GraphicsView (canvas) with specific dimensions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| graphicsView = new GraphicsView() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HeightRequest = 300, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WidthRequest = 300, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BackgroundColor = Colors.LightGray, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AutomationId = "GraphicsCanvas" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Create an overlapping label | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| overlayLabel = new Label() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text = "Overlay Label", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TextColor = Colors.Red, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FontSize = 16, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FontAttributes = FontAttributes.Bold, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HorizontalOptions = LayoutOptions.Start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VerticalOptions = LayoutOptions.Start, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Margin = new Thickness(10, 10, 0, 0), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AutomationId = "OverlayLabel" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| graphicsView.Drawable = drawable; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Add both canvas and label to the same grid cell (overlapping) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| canvasGrid.Add(graphicsView); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| canvasGrid.Add(overlayLabel); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Button row: Reset and Move buttons | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var buttonRow = new StackLayout() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Orientation = StackOrientation.Horizontal, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HorizontalOptions = LayoutOptions.Center, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Spacing = 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var resetButton = new Button() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text = "Reset Circles", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AutomationId = "ResetButton" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| resetButton.Clicked += ResetButton_Clicked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var moveButton = new Button() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Text = "Move to Edge Positions", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AutomationId = "MoveCirclesButton" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| moveButton.Clicked += MoveButton_Clicked; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buttonRow.Children.Add(resetButton); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buttonRow.Children.Add(moveButton); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Add all rows to the root layout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rootLayout.Add(canvasGrid, 0, 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rootLayout.Add(buttonRow, 0, 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Content = rootLayout; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void ResetButton_Clicked(object sender, EventArgs e) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Reset all circles to initial positions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drawable.ResetPositions(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| graphicsView.Invalidate(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void MoveButton_Clicked(object sender, EventArgs e) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Move circles to edge positions to test clipping | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drawable.MoveToEdgePositions(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| graphicsView.Invalidate(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class Issue20834_Drawable : IDrawable | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Circle data structure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class Issue20834_Circle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public float X { get; set; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public float Y { get; set; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public Color Color { get; set; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public float InitialX { get; set; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public float InitialY { get; set; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public Issue20834_Circle(float x, float y, Color color) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| X = x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Y = y; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InitialX = x; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InitialY = y; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Color = color; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private readonly List<Issue20834_Circle> _circles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private const float CircleDiameter = 100f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public Issue20834_Drawable() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Initialize 5 circles with different colors at initial positions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles = new List<Issue20834_Circle> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new Issue20834_Circle(50f, 50f, Colors.Blue), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new Issue20834_Circle(50f, 50f, Colors.Red), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new Issue20834_Circle(50f, 50f, Colors.Green), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new Issue20834_Circle(50f, 50f, Colors.Orange), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| new Issue20834_Circle(50f, 50f, Colors.Purple) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public void ResetPositions() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach (var circle in _circles) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| circle.X = circle.InitialX; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| circle.Y = circle.InitialY; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public void MoveToEdgePositions() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (_circles.Count >= 5) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[0].X = 250f; // Right | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[0].Y = 150f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[1].Y = 250f; // Bottom | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[1].X = 150f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[2].X = -50f; //left | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[2].Y = 150f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[3].Y = -50f; // top | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[3].X = 150f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[4].X = -50f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _circles[4].Y = -50f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public void Draw(ICanvas canvas, RectF dirtyRect) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | |
| // Use the latest canvas size to position circles at the edges | |
| if (_circles.Count >= 5) | |
| { | |
| // Right edge (circle just inside right edge) | |
| _circles[0].X = _canvasWidth - CircleDiameter; | |
| _circles[0].Y = _canvasHeight / 2 - CircleDiameter / 2; | |
| // Bottom edge | |
| _circles[1].X = _canvasWidth / 2 - CircleDiameter / 2; | |
| _circles[1].Y = _canvasHeight - CircleDiameter; | |
| // Left edge (circle just outside left edge) | |
| _circles[2].X = -CircleDiameter / 2; | |
| _circles[2].Y = _canvasHeight / 2 - CircleDiameter / 2; | |
| // Top edge (circle just outside top edge) | |
| _circles[3].X = _canvasWidth / 2 - CircleDiameter / 2; | |
| _circles[3].Y = -CircleDiameter / 2; | |
| // Top-left corner (circle just outside both top and left) | |
| _circles[4].X = -CircleDiameter / 2; | |
| _circles[4].Y = -CircleDiameter / 2; | |
| } | |
| } | |
| public void Draw(ICanvas canvas, RectF dirtyRect) | |
| { | |
| // Store the latest canvas size for edge calculations | |
| _canvasWidth = dirtyRect.Width; | |
| _canvasHeight = dirtyRect.Height; |
Binary file added
BIN
+18.6 KB
...tCases.Mac.Tests/snapshots/mac/GraphicsViewShouldClipCirclesAtEdgePositions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20834.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue20834 : _IssuesUITest | ||
| { | ||
| public Issue20834(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "[Android] GraphicsView can also be visible outside the canvas"; | ||
| protected override bool ResetAfterEachTest => true; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.GraphicsView)] | ||
| public void GraphicsViewShouldClipCirclesAtEdgePositions() | ||
| { | ||
| App.WaitForElement("MoveCirclesButton"); | ||
| App.Tap("MoveCirclesButton"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } |
Binary file added
BIN
+14.1 KB
....WinUI.Tests/snapshots/windows/GraphicsViewShouldClipCirclesAtEdgePositions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.6 KB
...tCases.iOS.Tests/snapshots/ios/GraphicsViewShouldClipCirclesAtEdgePositions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number 5 should be replaced with a named constant or use _circles.Count directly since exactly 5 circles are initialized in the constructor.