jsuarez/extra/embyr_deprecated/embyr/oldtrans.py [36:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class TouchWidget(Widget):
    def __init__(self, button, **kwargs):
        super().__init__(**kwargs)
        self.x, self.y, self.xVol, self.yVol = 0, 0, 0, 0
        self.button = button
        self.reset = True

    #Currently broken due to race condition?
    #def on_touch_down(self, touch):
    #    if touch.button == self.button: 
    #       self.xStart, self.yStart = touch.pos

    def on_touch_up(self, touch):
        if touch.button == self.button: 
            self.x += self.xVol
            self.y += self.yVol
            self.xVol, self.yVol= 0, 0
            self.reset = True

    def on_touch_move(self, touch):
        if self.reset:
           self.xStart, self.yStart = touch.pos
           self.reset = False

        if touch.button == self.button:
            xEnd, yEnd = touch.pos
            self.xVol = xEnd - self.xStart
            self.yVol = yEnd - self.yStart

class Zoom(Widget):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.zoom, self.delta = 1, 0.2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



jsuarez/extra/embyr_deprecated/embyr/transform.py [50:82]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class TouchWidget(Widget):
    def __init__(self, button, **kwargs):
        super().__init__(**kwargs)
        self.x, self.y, self.xVol, self.yVol = 0, 0, 0, 0
        self.button = button
        self.reset = True

    #Currently broken due to race condition?
    #def on_touch_down(self, touch):
    #    if touch.button == self.button: 
    #       self.xStart, self.yStart = touch.pos

    def on_touch_up(self, touch):
        if touch.button == self.button: 
            self.x += self.xVol
            self.y += self.yVol
            self.xVol, self.yVol= 0, 0
            self.reset = True

    def on_touch_move(self, touch):
        if self.reset:
           self.xStart, self.yStart = touch.pos
           self.reset = False

        if touch.button == self.button:
            xEnd, yEnd = touch.pos
            self.xVol = xEnd - self.xStart
            self.yVol = yEnd - self.yStart

class Zoom(Widget):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.zoom, self.delta = 1, 0.2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



