Add runtime.Gosched to update loader properly

This commit is contained in:
Ivan Danyliuk 2018-09-06 13:33:40 +03:00
parent 807721773b
commit 928a7dd3e8
No known key found for this signature in database
GPG Key ID: 97ED33CE024E1DBF
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"bytes"
"runtime"
"time"
"github.com/divan/graphx/formats"
@ -39,7 +40,7 @@ func main() {
for i := 0; i < steps; i++ {
l.UpdatePositions()
page.loader.Inc()
vecty.Rerender(page.loader)
runtime.Gosched()
}
page.loaded = true
vecty.Rerender(page)