Skip to content

Commit fcaf0d1

Browse files
author
Shengjie Xu
committed
[Core] Bugfix for imagepack summary image generation
1 parent 6922339 commit fcaf0d1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/preppipe/util/imagepack.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,8 @@ def write(self, pngpath : str):
22222222
equiv_rows = base_consumed_equivalent_diff_rows
22232223
max_diffs_in_right_side = base_consumed_equivalent_diff_rows * equiv_columns
22242224
# 先把右侧的填满
2225-
for i in range(max_diffs_in_right_side):
2225+
num_diffs_at_right = min(max_diffs_in_right_side, len(self.diffs))
2226+
for i in range(num_diffs_at_right):
22262227
if self.layout_diff_transpose:
22272228
# 先列后行
22282229
row = i % equiv_rows
@@ -2235,8 +2236,8 @@ def write(self, pngpath : str):
22352236
diff_order[row][col + base_consumed_equivalent_diff_cols] = i
22362237
# 再把下方的填满
22372238
bottom_rows = best_numdiffrows - equiv_rows
2238-
for i in range(max_diffs_in_right_side, len(self.diffs)):
2239-
equiv_index = i - max_diffs_in_right_side
2239+
for i in range(num_diffs_at_right, len(self.diffs)):
2240+
equiv_index = i - num_diffs_at_right
22402241
if self.layout_diff_transpose:
22412242
# 先列后行
22422243
row = equiv_index % bottom_rows

0 commit comments

Comments
 (0)