"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "7b64b4027006176bc8ee4d9773df4d8c63f58c17"
Unverified Commit 0438b406 authored by Double_V's avatar Double_V Committed by GitHub
Browse files

Merge pull request #6625 from ynjang/ynjang

update sorted_boxes
parents fe8d103c 7862bfc7
...@@ -114,11 +114,14 @@ def sorted_boxes(dt_boxes): ...@@ -114,11 +114,14 @@ def sorted_boxes(dt_boxes):
_boxes = list(sorted_boxes) _boxes = list(sorted_boxes)
for i in range(num_boxes - 1): for i in range(num_boxes - 1):
if abs(_boxes[i + 1][0][1] - _boxes[i][0][1]) < 10 and \ for j in range(i, 0, -1):
(_boxes[i + 1][0][0] < _boxes[i][0][0]): if abs(_boxes[j + 1][0][1] - _boxes[j][0][1]) < 10 and \
tmp = _boxes[i] (_boxes[j + 1][0][0] < _boxes[j][0][0]):
_boxes[i] = _boxes[i + 1] tmp = _boxes[j]
_boxes[i + 1] = tmp _boxes[j] = _boxes[j + 1]
_boxes[j + 1] = tmp
else:
break
return _boxes return _boxes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment