def clamp(self, actor, new_pos):
        x,y = new_pos
        if  x-actor.model_width//2<self.margin:
            x = self.margin + actor.model_width//2
        elif x+actor.model_width//2>self.world_width-self.margin:
            x = self.world_width-self.margin-actor.model_width//2
        if  y-actor.model_height//2<self.margin:
            y = self.margin + actor.model_height//2
        elif y+actor.model_height//2>self.world_height-self.margin:
            y = self.world_height-self.margin-actor.model_height//2
        return x,y
dataset/ETHPy150Open los-cocos/cocos/test/test_scrolling_manager_without_tiles_autoscale.py/SquareLand.clamp/original