def resize(self, x, y): direction = self.direction position = Position() position.x = self.x position.y = self.y size = Size() size.width = self.width size.height = self.height side = get_side(direction) if side is not VERTICAL: size.width = x - self.pivot.x if size.width < 0: position.x = x else: position.x = self.pivot.x if side is not HORIZONTAL: size.height = y - self.pivot.y if size.height < 0: position.y = y else: position.y = self.pivot.y self.set_position(position) self.set_size(size)
def resize(self, x, y): direction = self.direction position = Position() position.x = self.x position.y = self.y size = Size() size.width = self.width size.height = self.height side = get_side(direction) if side is not VERTICAL: size.width = x - self.pivot.x if size.width < 0: position.x = x else: position.x = self.pivot.x if side is not HORIZONTAL: size.height = y - self.pivot.y if size.height < 0: position.y = y else: position.y = self.pivot.y self.set_position(position) self.set_size(size)
def resize(self, x, y): source = Size() source.width = self.width source.height = self.height Object.resize(self, x, y) target = Size() target.width = self.width target.height = self.height if len(self.separators) > 0: for separator in self.separators: if separator.direction == HORIZONTAL and source.height and target.height: separator.position = separator.position / source.height * target.height separator.hidden = False elif separator.direction == VERTICAL and source.width and target.width: separator.position = separator.position / source.width * target.width separator.hidden = False else: separator.hidden = True
def resize(self, x, y): source = Size() source.width = self.width source.height = self.height Object.resize(self, x, y) target = Size() target.width = self.width target.height = self.height if len(self.separators) > 0: for separator in self.separators: if separator.direction == HORIZONTAL and source.height and target.height: separator.position = separator.position / source.height * target.height separator.hidden = False elif separator.direction == VERTICAL and source.width and target.width: separator.position = separator.position / source.width * target.width separator.hidden = False else: separator.hidden = True