~metalune/gofbi

e8d2e688043898111df97c744cd9e93d116e8777 — metalune 4 days ago 60bfc85
Add redraw command
2 files changed, 5 insertions(+), 1 deletions(-)

M README.md
M main.go
M README.md => README.md +1 -0
@@ 9,6 9,7 @@ Please keep in mind that this is WorkInProgress
`n`: Next Image
`p`: Previous Image
`q`: Quit
`r`: Redraw

## TODO


M main.go => main.go +4 -1
@@ 86,9 86,12 @@ func main() {
		in := string(b)

		idx_before := idx
		redraw := false
		if in == "q" {
			// exit
			break
		} else if in == "r" {
			redraw = true
		} else if in == "n" {
			// next picture
			if idx < max_idx {


@@ 107,7 110,7 @@ func main() {
			fmt.Println("Pressed key \"" + in + "\"")
		}

		if idx_before != idx {
		if idx_before != idx || redraw == true {
			// only redraw when the image has changed
			go draw_image(fb, imgs[idx], w, h, xoffset, yoffset)
		}