From b58d8bb996cbc85eaaac8d8cd9c1fb74cb36cdad Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 20 Jul 2017 02:20:15 +0900 Subject: [PATCH] text: Swap arguments face and text --- examples/font/main.go | 6 +++--- text/text.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/font/main.go b/examples/font/main.go index e2e159db5..edab3fb11 100644 --- a/examples/font/main.go +++ b/examples/font/main.go @@ -151,10 +151,10 @@ func update(screen *ebiten.Image) error { msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS()) const x = 20 - text.Draw(screen, mplusNormalFont, msg, x, 40, color.White) - text.Draw(screen, mplusNormalFont, sampleText, x, 80, color.White) + text.Draw(screen, msg, mplusNormalFont, x, 40, color.White) + text.Draw(screen, sampleText, mplusNormalFont, x, 80, color.White) for i, line := range strings.Split(string(kanjiText), "\n") { - text.Draw(screen, mplusBigFont, line, x, 160+54*i, codeToColor(kanjiText[0])) + text.Draw(screen, line, mplusBigFont, x, 160+54*i, codeToColor(kanjiText[0])) } return nil } diff --git a/text/text.go b/text/text.go index 2bea66880..0e240d8bf 100644 --- a/text/text.go +++ b/text/text.go @@ -258,7 +258,7 @@ var textM sync.Mutex // It is OK to call this function with a same text and a same face at every frame. // // This function is concurrent-safe. -func Draw(dst *ebiten.Image, face font.Face, text string, x, y int, clr color.Color) { +func Draw(dst *ebiten.Image, text string, face font.Face, x, y int, clr color.Color) { textM.Lock() n := now()