Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: papr <[email protected]>
  • Loading branch information
romanroibu and papr authored Apr 29, 2019
1 parent 350b215 commit 28ace73
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pupil_src/shared_modules/video_overlay/utils/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def __init__(self, value, constraint=NoConstraint()):

@property
def value(self):
return self._val
return self.constraint.apply_to(self._val)

@value.setter
def value(self, new_val):
self._val = self.constraint.apply_to(new_val)
self._val = new_val

@property
def constraint(self):
Expand All @@ -52,7 +52,6 @@ def constraint(self):
@constraint.setter
def constraint(self, new_constraint):
self._constraint = new_constraint
self.value = self.value # apply new constraint

@constraint.deleter
def constraint(self):
Expand Down

0 comments on commit 28ace73

Please sign in to comment.