Skip to content

Commit

Permalink
Fix enumerator boxing case in visual hit testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarchingCube committed Dec 7, 2019
1 parent 58b33ed commit d9aab14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,13 @@ public VisualNode Clone(IVisualNode parent)
/// <inheritdoc/>
public bool HitTest(Point p)
{
foreach (var operation in DrawOperations)
var drawOperations = DrawOperations;
var drawOperationsCount = drawOperations.Count;

for (var i = 0; i < drawOperationsCount; i++)
{
var operation = drawOperations[i];

if (operation?.Item?.HitTest(p) == true)
{
return true;
Expand Down

0 comments on commit d9aab14

Please sign in to comment.