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 scroll to tweens not being killed properly #59

Closed HaroldLever closed 2 months ago

HaroldLever commented 2 months ago

Minor bug fix.

func _set(property, value) -> bool:
    match property:
        "scroll_horizontal":
            if !content_node:
                scroll_horizontal = 0
                return true
            scroll_horizontal = value
            kill_scroll_x_to_tween()    # new
            velocity.x = 0.0
            pos.x = clampf(
                -value as float,
                -get_child_size_x_diff(content_node, true),
                0.0
            )
            return true
        "scroll_vertical":
            if !content_node:
                scroll_vertical = 0
                return true
            scroll_vertical = value
            kill_scroll_y_to_tween()    # new
            velocity.y = 0.0
            pos.y = clampf(
                -value as float,
                -get_child_size_y_diff(content_node, true),
                0.0
            )
            return true
        _:
            return false

Just a digression. #58