ui: Change the threshold to determine if the running is busy

This commit is contained in:
Hajime Hoshi 2016-02-28 02:48:49 +09:00
parent db2a43217e
commit 522b7370a4

6
run.go
View File

@ -106,9 +106,9 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
if int64(5*time.Second/60) < now-beforeForUpdate { if int64(5*time.Second/60) < now-beforeForUpdate {
beforeForUpdate = now beforeForUpdate = now
} else { } else {
c := int((now - beforeForUpdate) * 60 / int64(time.Second)) c := float64(now-beforeForUpdate) * 60 / float64(time.Second)
runContext.isRunningSlowly = c >= 2 runContext.isRunningSlowly = c >= 2.5
for i := 0; i < c; i++ { for i := 0; i < int(c); i++ {
if err := ui.DoEvents(); err != nil { if err := ui.DoEvents(); err != nil {
return err return err
} }