From 9fa764c7b989df95bf900c677a40b1c64f9653e8 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 27 Jul 2024 00:35:17 -0400 Subject: [PATCH] ScrollContainer can step scroll with normal up/down --- scrollcontainer.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scrollcontainer.go b/scrollcontainer.go index e90d745..185901a 100644 --- a/scrollcontainer.go +++ b/scrollcontainer.go @@ -210,6 +210,22 @@ func (this *ScrollContainer) handleKeyDown (key input.Key, numpad bool) bool { } this.scrollBy(vector) return true + case input.KeyUp: + if modifiers.Shift { + vector.X -= this.StepSize().X + } else { + vector.Y -= this.StepSize().Y + } + this.scrollBy(vector) + return true + case input.KeyDown: + if modifiers.Shift { + vector.X += this.StepSize().X + } else { + vector.Y += this.StepSize().Y + } + this.scrollBy(vector) + return true } return false }