bugfix: crash unless first mouse click on settings

This commit is contained in:
Kartik K. Agaram 2023-11-21 02:46:55 -08:00
parent 3d5a116ddf
commit 2bd99ec7fe
2 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
on_slider = function(slider, x,y)
if slider.x0 == nil then return end -- slider uninitialized
if x < slider.x0-slider.w/2 or x > slider.x1+slider.w/2 then return end
if y < slider.y0-slider.h/2 or y > slider.y0+slider.h/2 then return end
return true

View File

@ -1,4 +1,5 @@
on_area = function(s, x,y)
if s.x == nil then return end
if x < s.x then return end
if x > s.x+s.w then return end
if y < s.y then return end