bounds check overlay_onupdate_max_freq_seconds

develop
myk002 2022-11-09 15:48:24 -08:00
parent 56cf7e945c
commit 208e96c1b7
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 8 additions and 2 deletions

@ -455,9 +455,15 @@ OverlayWidget.ATTRS{
overlay_onupdate_max_freq_seconds=5, -- throttle calls to overlay_onupdate
}
-- set defaults for frame. the widget is expected to keep these up to date as
-- display contents change.
function OverlayWidget:init()
if self.overlay_onupdate_max_freq_seconds < 0 then
error(('overlay_onupdate_max_freq_seconds must be >= 0: %s')
:format(tostring(self.overlay_onupdate_max_freq_seconds)))
end
-- set defaults for frame. the widget is expected to keep these up to date
-- if display contents change so the widget position can shift if the frame
-- is relative to the right or bottom edges.
self.frame = self.frame or {}
self.frame.w = self.frame.w or 5
self.frame.h = self.frame.h or 1