Skip to content

Commit

Permalink
crop bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjinliu committed Aug 4, 2021
1 parent cf73ccc commit c5fe602
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impy/viewer/keybinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ def _crop_rectangle(img, crds, dims):
translate = np.empty(2)
for i in [0, 1]:
sl0 = sorted([start[i], end[i]])
x0 = int(sl0[0])+1
x1 = int(sl0[1])+1
x0 = max(int(sl0[0]), 0)
x1 = min(int(sl0[1]), img.sizeof(dims[i]))
sl.append(f"{dims[i]}={x0}:{x1}")
translate[i] = x0

Expand Down

0 comments on commit c5fe602

Please sign in to comment.