From 2ad6ab0dcf25968344441e58019cfa9ee1f2b91f Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 31 Jan 2024 03:51:30 +0900 Subject: [PATCH] exp/textinput: bug fix: position conversion was wrong --- exp/textinput/textinput_js.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exp/textinput/textinput_js.go b/exp/textinput/textinput_js.go index dba3e5c86..a116985ea 100644 --- a/exp/textinput/textinput_js.go +++ b/exp/textinput/textinput_js.go @@ -113,10 +113,9 @@ func (t *textInput) Start(x, y int) (chan State, func()) { t.textareaElement.Set("value", "") t.textareaElement.Call("focus") - xf, yf := ui.Get().LogicalPositionToClientPosition(float64(x), float64(y)) style := t.textareaElement.Get("style") - style.Set("left", fmt.Sprintf("%0.2fpx", xf)) - style.Set("top", fmt.Sprintf("%0.2fpx", yf)) + style.Set("left", fmt.Sprintf("%dpx", x)) + style.Set("top", fmt.Sprintf("%dpx", y)) s := newSession() t.session = s