Skip to content

Commit

Permalink
bad mouse coords
Browse files Browse the repository at this point in the history
  • Loading branch information
liamg committed Nov 27, 2018
1 parent 99e0baf commit 08c0197
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui/mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 08c0197

Please sign in to comment.