SpyrexDE / SmoothScroll

Addon for the Godot Game Engine that adds a SmoothScrollContainer.
https://spyrexde.github.io/SmoothScroll/
MIT License
132 stars 10 forks source link

Fix issue with is_scrolling and hiding scroll bar #35

Closed HaroldLever closed 8 months ago

HaroldLever commented 8 months ago

I found is_scrolling presenting wrong value due to velocity not being 0. Scrolling Issue Therefore, I refactor should_scroll. Now all "allow_scoll_horizontal/vertical" are replaced with should_scroll_horizontal/vertical(). Also, I found there was snapping issue and I fixed it.

There was flickering issue with scroll bar, because showing and hiding tweeners are fighting. You can try scrollbar_fade_in_time=0.2, scrollbar_fade_out_time=2.0 and you will see the issue. Tween Issue I kill() the existing tween and create a new one. And I add a timer.start() in _ready() because there might be no input for a while once container enter scene tree.

Now the scoll bar alpha will be refresh if hide_scrollbar_over_time is changed. Refresh Scoll Bar Alpha

SpyrexDE commented 8 months ago

Great changes. Regarding the hide scrollbar over time, it might be useful for some users to keep showing the scrollbar until it was scrolled (or at least hovered) once. By the way: Do you have any idea why the normal scroll container used for the debug information is not scrollable at all?

HaroldLever commented 8 months ago

Well, I thought it was a bug, and I guess other users might have the same thought, so personally I would like to preserve this change. Maybe you can revert it if you think that's a necessary feature.

Regarding the hide scrollbar over time, it might be useful for some users to keep showing the scrollbar until it was scrolled (or at least hovered) once.

Uncheck the "Scroll Following" of the rich text label. It will try to scroll to the end of new content and the script refreshes it every frame, which makes it not scrollable at all.

By the way: Do you have any idea why the normal scroll container used for the debug information is not scrollable at all?