diff options
Diffstat (limited to 'pixelmappers')
-rw-r--r-- | pixelmappers/SimpleMapper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pixelmappers/SimpleMapper.py b/pixelmappers/SimpleMapper.py index 6b414ea..bc51cf9 100644 --- a/pixelmappers/SimpleMapper.py +++ b/pixelmappers/SimpleMapper.py @@ -19,8 +19,10 @@ class SimpleMapper(PixelMapper): eventLocation = eventLocation.replace('{y}', 'pixel.location[1]') for pixel in screen: try: - pixelValid = sum(eval(eventLocation)) == len(eventLocation) - ret.append((pixel, 1)) + pixelValid = sum(eval(eventLocation)) == len(eval(eventLocation)) #TODO: some + #optimizations possible. This might be slow in the long run + if pixelValid: + ret.append((pixel, 1)) except: raise Exception('Bad event condition') return ret |