mirror of
https://github.com/felixangell/phi.git
synced 2024-09-11 15:55:25 +03:00
scrolling bounds checks
This commit is contained in:
parent
7c4706356b
commit
112cdc74d6
@ -370,13 +370,15 @@ func (b *Buffer) scrollUp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Buffer) scrollDown() {
|
func (b *Buffer) scrollDown() {
|
||||||
// TODO move the cursor down 45 lines
|
if b.cam.y < len(b.contents) {
|
||||||
// IF the buffer exceeds the window size.
|
// TODO move the cursor down 45 lines
|
||||||
lineScrollAmount := 10
|
// IF the buffer exceeds the window size.
|
||||||
|
lineScrollAmount := 10
|
||||||
|
|
||||||
b.cam.y += lineScrollAmount
|
b.cam.y += lineScrollAmount
|
||||||
for i := 0; i < lineScrollAmount; i++ {
|
for i := 0; i < lineScrollAmount; i++ {
|
||||||
b.moveDown()
|
b.moveDown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user