Esempio n. 1
0
    def create_widget(self, ix, iy, fx, fy):
        radius = math.hypot(ix - fx, iy - fy)
        pos = (ix - radius, iy - radius)
        size = (2 * radius, 2 * radius)

        return DraggableWidget(pos=pos, size=size)
Esempio n. 2
0
    def create_widget(self, ix, iy, fx, fy):
        pos = (min(ix, fx), min(iy, fy))
        size = (abs(fx - ix), abs(fy - iy))

        return DraggableWidget(pos=pos, size=size)
Esempio n. 3
0
 def create_widget(self,ix,iy,fx,fy):
     r = math.hypot(ix-fx, iy-fy)
     pos = (ix-r, iy-r)
     size = (2*r, 2*r)
     return DraggableWidget(pos = pos, size = size)