awesome-gocui / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
350 stars 39 forks source link

Fix highlight and mouse ignoring origin when interacting with cursor #119

Closed ekkkkkknoes closed 2 years ago

ekkkkkknoes commented 2 years ago

This fixes #118 by doing two things:

  1. gui.go: When changing cursor position after receiving mouse events, add x- and y-Origin to the cursor position to place the cursor right under the mouse
  2. view.go: When deciding which line to highlight, take y-Origin into account to ensure the line under the cursor is the one that's highlighted.
ekkkkkknoes commented 2 years ago

Hey, I've fixed the formatting that caused the workflow to fail a while ago. Could you approve the workflow again?