def setRelPos(self, rp): self.relPos = rp sec = self.getUserData() # now calculate the absolute x,y in SAGE coords based on the section-relative position if self.direction == HORIZONTAL: x = sec.getX() y = int(sec.bounds.bottom + sec.bounds.getHeight()*rp) else: y = sec.getY() x = int(sec.bounds.left + sec.bounds.getWidth()*rp) newSpace = abs(x-self.getX()), abs(y-self.getY()) EventHandler.setPos(self, x, y) return newSpace
def setPos(self, x, y): EventHandler.setPos(self, x, y)