blob: 7d730f1c2c8246d0b606ade18459966f87f6b334 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
from operationscore.PixelMapper import *
import Util
class SimpleMapper(PixelMapper):
def mappingFunction(self, eventLocation, screen):
bestDist = 10**10 #don't kill me, I'm lazy
bestPixel = None
for pixel in screen:
pixelDist = Util.dist(pixel.location, eventLocation)
if pixelDist < bestDist:
bestPixel = pixel
bestDist = pixelDist
return [(bestPixel,1)]
|