mirror of https://github.com/liamg/aminal.git
bad mouse coords
This commit is contained in:
parent
99e0baf6b3
commit
08c0197ec0
|
@ -57,6 +57,9 @@ func (gui *GUI) mouseButtonCallback(w *glfw.Window, button glfw.MouseButton, act
|
|||
|
||||
// before we forward clicks on (below), we need to handle them locally for url clicking, text highlighting etc.
|
||||
px, py := w.GetCursorPos()
|
||||
scale := gui.scale()
|
||||
px = px / float64(scale)
|
||||
py = py / float64(scale)
|
||||
x := uint16(math.Floor((px - float64(gui.renderer.areaX)) / float64(gui.renderer.CellWidth())))
|
||||
y := uint16(math.Floor((py - float64(gui.renderer.areaY)) / float64(gui.renderer.CellHeight())))
|
||||
tx := int(x) + 1 // vt100 is 1 indexed
|
||||
|
|
Loading…
Reference in New Issue