Avoid negative CSS widths

This commit is contained in:
df 2021-02-23 00:13:08 +00:00 committed by HummyPkg
parent 73d25247f0
commit 47495e7b8d
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ puts "<div style=\"position: relative; top: -10px\">"
proc div {type left right} {
set width $($right - $left)
if {$width < 0} {
# negative values are invalid for CSS width
set width 0
}
puts "<div class=$type style=\"left: ${left}px; width: ${width}px\">
$type</div>"
}