-
Notifications
You must be signed in to change notification settings - Fork 5
Add horizontal scrolling and support for nesting ScrollingPanes #72
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
flibber-hk
merged 11 commits into
silksong-modding:main
from
kaycodes13:feature/nested-and-horizontal-scrolling
Apr 29, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4ca3ad3
add support for nesting ScrollingPanes
kaycodes13 290cd40
add basic horizontal scrolling support to ScrollPanes
kaycodes13 5c696d3
adjust element prefabs widths for more reasonable horizontal scrolling
kaycodes13 ea7ecb5
improve scroll autofocusing for nested & sibling scroll panes
kaycodes13 2eadaa8
fix off-center horizontal scroll target for slider elements
kaycodes13 0bd075c
auto-scrolling on two axes now works
kaycodes13 22d8559
Merge branch 'silksong-modding:main' into feature/nested-and-horizont…
kaycodes13 1fe0b06
Merge branch 'main' into feature/nested-and-horizontal-scrolling
flibber-hk 5a9d0f4
miscellaneous ScrollingPane cleanup
kaycodes13 83e7500
use .RectTransform extension in more places
kaycodes13 e331b9d
fix the backwards horizontal mousewheel scrolling issue
kaycodes13 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
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
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,25 @@ | ||
| using UnityEngine; | ||
| using UnityEngine.EventSystems; | ||
| using UnityEngine.UI; | ||
|
|
||
| namespace Silksong.ModMenu.Internal; | ||
|
|
||
| /// <summary> | ||
| /// Identical to the regular <see cref="ScrollRect"/>, except it fixes the known bug | ||
| /// (See <see href="https://discussions.unity.com/t/934765">this Unity help forum post</see>) | ||
| /// where mousewheel/touchpad scrolling is always the opposite of what it should intuitively be for one scroll direction. | ||
| /// </summary> | ||
| internal class CustomScrollRect : ScrollRect | ||
| { | ||
| public override void OnScroll(PointerEventData data) | ||
| { | ||
| if (horizontal) | ||
| { | ||
| if (vertical) | ||
| data.scrollDelta *= new Vector2(-1, 1); | ||
| else | ||
| data.scrollDelta *= -1; | ||
| } | ||
| base.OnScroll(data); | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.