parent
71776baccc
commit
f27f9fe259
@ -353,12 +353,13 @@ 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]
|
||||
targetRow = None
|
||||
if c[4] in (1, 2):
|
||||
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]:
|
||||
break
|
||||
while rows[c[4]][row] == targetRow:
|
||||
row += 1
|
||||
res += 1
|
||||
else:
|
||||
@ -367,13 +368,13 @@ def TestFreeRows(rows, c, row, width, height, bottomReserved, lifetime):
|
||||
except ZeroDivisionError:
|
||||
thresholdTime = c[0]-lifetime
|
||||
while row < rowmax and res < c[7]:
|
||||
if targetRow != rows[c[4]][row]:
|
||||
targetRow = rows[c[4]][row]
|
||||
try:
|
||||
if targetRow and (targetRow[0] > thresholdTime or targetRow[0]+targetRow[8]*lifetime/(targetRow[8]+width) > c[0]):
|
||||
break
|
||||
except ZeroDivisionError:
|
||||
pass
|
||||
while rows[c[4]][row] == targetRow:
|
||||
row += 1
|
||||
res += 1
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user