ScrollContainer does not scroll child in a forbidden direction

This commit is contained in:
Sasha Koshka 2023-03-21 17:37:33 -04:00
parent d9bddce20b
commit dcc672e2bc

View File

@ -152,6 +152,9 @@ func (element *ScrollContainer) HandleScroll (
x, y int,
deltaX, deltaY float64,
) {
horizontal, vertical := element.child.ScrollAxes()
if !horizontal { deltaX = 0 }
if !vertical { deltaY = 0 }
element.scrollChildBy(int(deltaX), int(deltaY))
}