#485 fixed assertion with height auto incrementing y when inheriting height

This commit is contained in:
Mikayla Fischler 2024-05-04 13:50:53 -04:00
parent 25dc47d520
commit 3bfcb1d83c
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -3,6 +3,7 @@
-- --
local util = require("scada-common.util") local util = require("scada-common.util")
local log = require("scada-common.log")
local core = require("graphics.core") local core = require("graphics.core")
@ -198,6 +199,9 @@ function element.new(args, child_offset_x, child_offset_y)
---@param offset_y integer y offset for mouse events ---@param offset_y integer y offset for mouse events
---@param next_y integer next line if no y was provided ---@param next_y integer next line if no y was provided
function protected.prepare_template(offset_x, offset_y, next_y) function protected.prepare_template(offset_x, offset_y, next_y)
-- don't auto incrememnt y if inheriting height, that would cause an assertion
next_y = util.trinary(args.height == nil, 1, next_y)
-- record offsets in case there is a reposition -- record offsets in case there is a reposition
self.offset_x = offset_x self.offset_x = offset_x
self.offset_y = offset_y self.offset_y = offset_y