fix a long-standing issue with tooltips

scenario:
- open Carousel with more than one screen, so that there are buttons on
  the left and right margins
- move the mouse rapidly towards the left or right off the edge of the
  screen

Before this commit, the tooltip would remain showing after the mouse
went off window. (Things were fine if the mouse moved slowly off window;
then LÖVE had a chance to record the mouse coordinate on the edge before
it went off edge.)
This commit is contained in:
Kartik K. Agaram 2024-05-20 00:47:43 -07:00
parent 305542401b
commit affa108ecf
3 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,7 @@ on.draw = function()
end
draw_menu()
draw_next_frames_of_animations()
if Window_in_focus then
if Window_in_focus and Mouse_on_window then
draw_button_tooltips(Global_state)
end
end

1
0179-Mouse_on_window Normal file
View File

@ -0,0 +1 @@
Mouse_on_window = true

3
0180-on.mouse_focus Normal file
View File

@ -0,0 +1,3 @@
on.mouse_focus = function(in_focus)
Mouse_on_window = in_focus
end