From 06398704104d156808a7362b0e02aabdc9668731 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Mon, 14 Oct 2024 13:23:42 -0400 Subject: [PATCH] comments and cleanup --- graphics/elements/form/NumberField.lua | 6 ++---- pocket/ui/apps/process.lua | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/graphics/elements/form/NumberField.lua b/graphics/elements/form/NumberField.lua index 03e63e5..d582f5b 100644 --- a/graphics/elements/form/NumberField.lua +++ b/graphics/elements/form/NumberField.lua @@ -53,7 +53,7 @@ return function (args) end -- set the value to a formatted numeric string
- -- trims trailing zeros + -- trims trailing zeros from floating point numbers ---@param num number local function _set_value(num) local str = util.sprintf(format, num) @@ -185,9 +185,7 @@ return function (args) -- handle unfocused function e.on_unfocused() - local val = tonumber(e.value) - local max = tonumber(args.max) - local min = tonumber(args.min) + local val, max, min = tonumber(e.value), tonumber(args.max), tonumber(args.min) if val then if args.max_int_digits or args.max_frac_digits then diff --git a/pocket/ui/apps/process.lua b/pocket/ui/apps/process.lua index 5b014ce..deb7b1f 100644 --- a/pocket/ui/apps/process.lua +++ b/pocket/ui/apps/process.lua @@ -229,9 +229,9 @@ local function new_view(root) auto_ramp.register(f_ps, "auto_ramping", auto_ramp.update) auto_sat.register(f_ps, "auto_saturated", auto_sat.update) - -- REGISTER_NOTE: for optimization/brevity, due to not deleting anything but the whole element tree when it comes - -- to the process control display and coordinator GUI as a whole, child elements will not directly be registered here - -- (preventing garbage collection until the parent 'proc' is deleted) + -- REGISTER_NOTE: for optimization/brevity, due to not deleting anything but the whole element tree + -- when it comes to unloading the process app, child elements will not directly be registered here + -- (preventing garbage collection until the parent 'page_div' is deleted) page_div.register(f_ps, "auto_active", function (active) if active then b_target.disable()