question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Input order does not match display order

See original GitHub issue

Scenario: We have a Drawable Hierarchie, as follows:

new CompositeDrawable{
    InternalChildren = new Drawable[]{
        new SomeClickableThing{
        },
        new SomeOtherClickableThing{
            Depth = 1f
        },  
    }
}

Currently IsHovered (as well as everything affected by PositionalInputQueue and buildPositionalInputQueue) will not take Depth into account. This means sometimes you click on Elements that are behind others, if a earlier child has a lower depth value.

This is a limitation I ran into in osu/#21119, which I will now consider as blocked from merging until this issue gets resolved (or my workaround is in a acceptable state). I do have a fix currently in place see this commit, but that causes the Settings of selected Elements to ease-in all of their settings every MouseDragEvent, which is also not ideal. (also just whilst writing this I see that this fix is somewhat stupid. I really only need to run that when the Ordering of Items inside a DrawableList actually changes. That still wouldn’t solve the core issue though.)

I believe this could be solved adding a OrderBy(d => d.Depth) in InputManager. I am not sure of the exact Consequences of this, which is why this is not a pr. https://github.com/ppy/osu-framework/blob/7f7ce8149623f5efcb2cc1110fec1b503b812693/osu.Framework/Input/InputManager.cs#L611

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
C0D3-M4513Rcommented, Dec 12, 2022

The issue is, that without the linked commit SkinBlueprint’s in the SkinEditor/SkinBlueprintContainer would only get selected in the order they were added. See https://github.com/ppy/osu/pull/21119#issuecomment-1344529992. This demonstrates it really really well. When an item changes it’s position, I simply set the Item depth of the associated SkinBlueprint and SkinBlueprint.Item.

I am going to try and make a simple Test, that demonstrates it in osu.Framework

Edit: Oh. You are the person that sent that Message LUL.

0reactions
C0D3-M4513Rcommented, Dec 12, 2022

I have started investigating SelectionBlueprint, and think that maybe there is something funky going on there, which prevents IsHovered from being updated. With the above snippets I’m fairly certain, that this is NOT a framework bug. If can prove otherwise, I will reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Order of the output doesn't match the order while running ...
I am writing a function to display output based on the IDs the user selects. The dataset have IDs starting from 1 to...
Read more >
Potential error caused by different column order #7242
Finally, we found out the problem was that the column order of the new dataset was different from the old one. Thus the...
Read more >
C27: Making the DOM order match the visual order
Setting tabindex values that result in an order different from the order of elements in the Document Object Model (DOM) can mean the...
Read more >
Forms response columns are out of order
Workaround. To work around this issue, locate the Responses tab on the form, click the ellipses, and then select Sync all responses to...
Read more >
Column order within Power Query is not reflected i...
I can confirm that I fixed the issue via the following steps : 1) Diasble Query Load. Ensure Query is no longer showing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found