Closed
Description
The current textModel
is only working when there is one TextField displayed.
Reproduce the bug by using the simpleDemo example. The embedder crash when words are typed in a TextField when there is another TextField displayed on the screen that has been filled.
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
github.com/Drakirus/go-flutter-desktop-embedder.(*textModel).addChar(0x634080, 0xc0000a9c74, 0x1, 0x1)
/home/drakirus/lab/go/src/github.com/Drakirus/go-flutter-desktop-embedder/textModel.go:32 +0x15e
github.com/Drakirus/go-flutter-desktop-embedder.glfwCharCallback(0xc0000b6000, 0x66)
/home/drakirus/lab/go/src/github.com/Drakirus/go-flutter-desktop-embedder/gutter.go:198 +0x76
github.com/go-gl/glfw/v3.2/glfw.goCharCB(0xef9990, 0x66)
/home/drakirus/lab/go/src/github.com/go-gl/glfw/v3.2/glfw/input.go:294 +0x51
github.com/go-gl/glfw/v3.2/glfw._cgoexpwrap_f7a05a868eb7_goCharCB(0xef9990, 0x66)
_cgo_gotypes.go:2147 +0x33
github.com/go-gl/glfw/v3.2/glfw._Cfunc_glfwPollEvents()
_cgo_gotypes.go:1196 +0x41
github.com/go-gl/glfw/v3.2/glfw.PollEvents()
/home/drakirus/lab/go/src/github.com/go-gl/glfw/v3.2/glfw/window.go:777 +0x20
github.com/Drakirus/go-flutter-desktop-embedder.Run(0xc0000a9f70, 0x3, 0x3, 0x0, 0x0)
/home/drakirus/lab/go/src/github.com/Drakirus/go-flutter-desktop-embedder/gutter.go:80 +0x21d
main.main()
/home/drakirus/lab/go/src/go-flutter-desktop-embedder/example/demo/main.go:25 +0xc6