mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 20:28:54 +01:00
exp/textinput: bug fix: position conversion was wrong
This commit is contained in:
parent
f9fa5a14f2
commit
2ad6ab0dcf
@ -113,10 +113,9 @@ func (t *textInput) Start(x, y int) (chan State, func()) {
|
|||||||
t.textareaElement.Set("value", "")
|
t.textareaElement.Set("value", "")
|
||||||
t.textareaElement.Call("focus")
|
t.textareaElement.Call("focus")
|
||||||
|
|
||||||
xf, yf := ui.Get().LogicalPositionToClientPosition(float64(x), float64(y))
|
|
||||||
style := t.textareaElement.Get("style")
|
style := t.textareaElement.Get("style")
|
||||||
style.Set("left", fmt.Sprintf("%0.2fpx", xf))
|
style.Set("left", fmt.Sprintf("%dpx", x))
|
||||||
style.Set("top", fmt.Sprintf("%0.2fpx", yf))
|
style.Set("top", fmt.Sprintf("%dpx", y))
|
||||||
|
|
||||||
s := newSession()
|
s := newSession()
|
||||||
t.session = s
|
t.session = s
|
||||||
|
Loading…
Reference in New Issue
Block a user