Skip to content

Commit

Permalink
roi now only drawn in draw roi mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassner committed Jun 9, 2014
1 parent e7ae97c commit e3b9cc2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pupil_src/capture/eye.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ def on_char(window,char):
def on_button(window,button, action, mods):
if not atb.TwEventMouseButtonGLFW(button,int(action == GLFW_PRESS)):
if action == GLFW_PRESS:
pos = glfwGetCursorPos(window)
pos = normalize(pos,glfwGetWindowSize(window))
pos = denormalize(pos,(frame.img.shape[1],frame.img.shape[0]) ) # pos in frame.img pixels
u_r.setStart(pos)
bar.draw_roi.value = 1
if bar.display.value ==1:
pos = glfwGetCursorPos(window)
pos = normalize(pos,glfwGetWindowSize(window))
pos = denormalize(pos,(frame.img.shape[1],frame.img.shape[0]) ) # pos in frame.img pixels
u_r.setStart(pos)
bar.draw_roi.value = 1
else:
bar.draw_roi.value = 0

Expand Down

0 comments on commit e3b9cc2

Please sign in to comment.