wibox.widget.base.place_widget_*: Protect against negative sizes
This commits adds assertions to catch negative width or height. Would-have-helped-with: https://github.com/awesomeWM/awesome/issues/2799 Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
f025409cd3
commit
2aa198a57b
|
@ -397,6 +397,8 @@ end
|
||||||
-- @treturn table An opaque object that can be returned from `:layout()`.
|
-- @treturn table An opaque object that can be returned from `:layout()`.
|
||||||
-- @staticfct wibox.widget.base.place_widget_via_matrix
|
-- @staticfct wibox.widget.base.place_widget_via_matrix
|
||||||
function base.place_widget_via_matrix(widget, mat, width, height)
|
function base.place_widget_via_matrix(widget, mat, width, height)
|
||||||
|
assert(width >= 0, "A widget's width cannot be negative: " .. tostring(width))
|
||||||
|
assert(height >= 0, "A widget's height cannot be negative: " .. tostring(height))
|
||||||
return {
|
return {
|
||||||
_widget = widget,
|
_widget = widget,
|
||||||
_width = width,
|
_width = width,
|
||||||
|
|
Loading…
Reference in New Issue