From 65ca48d184df99b2a32bf02190f31f444cc1606e Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Mon, 2 Dec 2013 22:38:44 +0800 Subject: [PATCH] Boundary condition --- danmaku2ass.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/danmaku2ass.py b/danmaku2ass.py index eaec8b3..f90bfa0 100755 --- a/danmaku2ass.py +++ b/danmaku2ass.py @@ -351,10 +351,10 @@ def ProcessComments(comments, f, width, height, bottomReserved, fontface, fontsi def TestFreeRows(rows, c, row, width, height, bottomReserved, lifetime): res = 0 - rowmax = height-bottomReserved-c[7] + rowmax = height-bottomReserved targetRow = None if c[4] in (1, 2): - while row <= rowmax and res < c[7]: + while row < rowmax and res < c[7]: if targetRow != rows[c[4]][row]: targetRow = rows[c[4]][row] if targetRow and targetRow[0]+lifetime > c[0]: @@ -366,7 +366,7 @@ def TestFreeRows(rows, c, row, width, height, bottomReserved, lifetime): thresholdTime = c[0]-lifetime*(1-width/(c[8]+width)) except ZeroDivisionError: thresholdTime = c[0]-lifetime - while row <= rowmax and res < c[7]: + while row < rowmax and res < c[7]: if targetRow != rows[c[4]][row]: targetRow = rows[c[4]][row] try: