Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit e003fef

Browse files
committed
[FIX] update edges index out of range
Fixes #210
1 parent 940e0cc commit e003fef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

camelot/core.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,9 @@ def _set_vertical_edges(self, vertical, joint_tol):
683683
def _update_vertical_edges(self, start, end, index):
684684
if index is None: # only right edge
685685
index = len(self.cols) - 1
686-
for j in range(start, end):
687-
self.cells[j][index].right = True
686+
if index >= 0:
687+
for j in range(start, end):
688+
self.cells[j][index].right = True
688689
elif index == 0: # only left edge
689690
for j in range(start, end):
690691
self.cells[j][0].left = True
@@ -709,8 +710,9 @@ def _set_horizontal_edges(self, horizontal, joint_tol):
709710
def _update_horizontal_edges(self, start, end, index):
710711
if index is None: # only bottom edge
711712
index = len(self.rows) - 1
712-
for j in range(start, end):
713-
self.cells[index][j].bottom = True
713+
if index >= 0:
714+
for j in range(start, end):
715+
self.cells[index][j].bottom = True
714716
elif index == 0: # only top edge
715717
for j in range(start, end):
716718
self.cells[0][j].top = True

0 commit comments

Comments
 (0)