fixed out of bounds coordinates crashing GUI for form fields

This commit is contained in:
Mikayla Fischler 2023-12-17 12:56:08 -05:00
parent 55ccdd63d4
commit f23b7e2c2f
3 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")
local core = {}
core.version = "2.0.8"
core.version = "2.0.9"
core.flasher = flasher
core.events = events

View File

@ -50,7 +50,7 @@ local function number_field(args)
if core.events.was_clicked(event.type) then
e.take_focus()
if event.type == MOUSE_CLICK.UP then
if event.type == MOUSE_CLICK.UP and e.in_frame_bounds(event.current.x, event.current.y) then
ifield.move_cursor(event.current.x)
end
elseif event.type == MOUSE_CLICK.DOUBLE_CLICK then

View File

@ -45,7 +45,7 @@ local function text_field(args)
if core.events.was_clicked(event.type) then
e.take_focus()
if event.type == MOUSE_CLICK.UP then
if event.type == MOUSE_CLICK.UP and e.in_frame_bounds(event.current.x, event.current.y) then
ifield.move_cursor(event.current.x)
end
elseif event.type == MOUSE_CLICK.DOUBLE_CLICK then