Skip to content

Commit

Permalink
Make DrawVisualiser follow proxied drawables to their visual layer
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Nov 11, 2024
1 parent 109df77 commit 6b849a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ private void updateCursorTarget()
// Finds the targeted drawable and composite drawable. The search stops if a drawable is targeted.
void findTarget(Drawable drawable)
{
// Ignore proxied drawables (they may be at a different visual layer).
if (drawable.HasProxy)
return;

// When a proxy is encountered, restore the original drawable for target testing.
while (drawable.IsProxy)
drawable = drawable.Original;

if (drawable == this || drawable is Component)
return;

Expand Down

0 comments on commit 6b849a9

Please sign in to comment.