Skip to content

Commit

Permalink
FranzCross,mixin: fix context selection on Windows when scrolled
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Oct 13, 2023
1 parent 784f779 commit ec9f83e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions FranzCross/mixin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@
(define item-height
(quotient
(send receiver get-height)
(send receiver number-of-visible-items)))
(add1 (send receiver number-of-visible-items))))
(define y-pos
(let ([y (send event get-y)])
(case (system-type 'os)
[(windows) ;; does not include scroll offset
(+ y (* item-height (send receiver get-first-visible-item)))]
[else y])))
(define item-index
(let* ([index (quotient (send event get-y) item-height)]
(let* ([index (quotient y-pos item-height)]
[index (case (system-type 'os)
[(macosx) index] ;; the first non-header row has y=0
[else (sub1 index)])])
Expand Down

0 comments on commit ec9f83e

Please sign in to comment.