Skip to content

Commit

Permalink
Merge pull request #1624 from pfaion/fix_circle_color_change_crash
Browse files Browse the repository at this point in the history
Fix circle color change crash
  • Loading branch information
papr authored Sep 10, 2019
2 parents fbd8e9f + b6f6a79 commit a51a97b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pupil_src/shared_modules/player_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def correlate_data(data, timestamps):

def transparent_circle(img, center, radius, color, thickness):
center = tuple(map(int, center))
assert len(color) == 4 and all(type(c) == float and 0.0 <= c <= 1.0 for c in color)
assert len(color) == 4 and all(type(c) == float for c in color)
color = np.clip(color, 0.0, 1.0) # sometimes the sliders returns values > 1.0
bgr = [255 * c for c in color[:3]] # convert to 0-255 scale for OpenCV
alpha = color[-1]
radius = int(radius)
Expand Down

0 comments on commit a51a97b

Please sign in to comment.