diff --git a/scripts/dbgbmap.py b/scripts/dbgbmap.py index 9eb7b3fd..cbf0d82c 100755 --- a/scripts/dbgbmap.py +++ b/scripts/dbgbmap.py @@ -4598,11 +4598,11 @@ def main_(ring, disk, mroots=None, *, # well for things that are often powers-of-two block_cols_ = 1 block_rows_ = len(bmap) - while (abs(((canvas.width/(block_cols_ * 2)) - / (canvas.height/mt.ceil(block_rows_ / 2))) + while (abs(((canvas.width/(block_cols_*2)) + / max(canvas.height/mt.ceil(block_rows_/2), 1)) - block_ratio) < abs(((canvas.width/block_cols_) - / (canvas.height/block_rows_))) + / max(canvas.height/block_rows_, 1))) - block_ratio): block_cols_ *= 2 block_rows_ = mt.ceil(block_rows_ / 2) diff --git a/scripts/dbgbmapd3.py b/scripts/dbgbmapd3.py index 795fd3b6..352ec076 100755 --- a/scripts/dbgbmapd3.py +++ b/scripts/dbgbmapd3.py @@ -4918,11 +4918,11 @@ def main(disk, output, mroots=None, *, # well for things that are often powers-of-two block_cols_ = 1 block_rows_ = len(bmap) - while (abs(((width__/(block_cols_ * 2)) - / (height__/mt.ceil(block_rows_ / 2))) + while (abs(((width__/(block_cols_*2)) + / max(height__/mt.ceil(block_rows_/2), 1)) - block_ratio) < abs(((width__/block_cols_) - / (height__/block_rows_))) + / max(height__/block_rows_, 1))) - block_ratio): block_cols_ *= 2 block_rows_ = mt.ceil(block_rows_ / 2) diff --git a/scripts/tracebd.py b/scripts/tracebd.py index d5789836..4aa3aefb 100755 --- a/scripts/tracebd.py +++ b/scripts/tracebd.py @@ -1794,11 +1794,11 @@ def main(path='-', *, # well for things that are often powers-of-two block_cols_ = 1 block_rows_ = len(bmap) - while (abs(((canvas.width/(block_cols_ * 2)) - / (canvas.height/mt.ceil(block_rows_ / 2))) + while (abs(((canvas.width/(block_cols_*2)) + / max(canvas.height/mt.ceil(block_rows_/2), 1)) - block_ratio) < abs(((canvas.width/block_cols_) - / (canvas.height/block_rows_))) + / max(canvas.height/block_rows_, 1))) - block_ratio): block_cols_ *= 2 block_rows_ = mt.ceil(block_rows_ / 2)