From 328900ec8099566aafa30787a0dc6d9a29a876be Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 9 Apr 2016 02:36:30 +0900 Subject: [PATCH] ui: Bug fix: 'frames' should be incremanted only when drawing happens --- run.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.go b/run.go index 0744ce721..f2d428827 100644 --- a/run.go +++ b/run.go @@ -214,10 +214,10 @@ func Run(f func(*Image) error, width, height, scale int, title string) error { } ui.CurrentUI().SwapBuffers() beforeForUpdate += int64(t) * int64(time.Second/FPS) + frames++ } // Calc the current FPS. - frames++ if time.Second <= time.Duration(now-beforeForFPS) { currentRunContext.updateFPS(float64(frames) * float64(time.Second) / float64(now-beforeForFPS)) beforeForFPS = now