Avoid negative CSS widths
This commit is contained in:
parent
cc5a9d6df1
commit
805b90a591
@ -37,6 +37,10 @@ puts "<div style=\"position: relative; top: -10px\">"
|
|||||||
|
|
||||||
proc div {type left right} {
|
proc div {type left right} {
|
||||||
set width $($right - $left)
|
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\">
|
puts "<div class=$type style=\"left: ${left}px; width: ${width}px\">
|
||||||
$type</div>"
|
$type</div>"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user