public function transformPoint($x, $y, $width = 0, $height = 0)
    {
        $right = $this->x + $this->size;
        $bottom = $this->y + $this->size;
        
        switch ($this->rotation) {
            case 1: return new Point($right - $y - $height, $this->y + $x);
            case 2: return new Point($right - $x - $width, $bottom - $y - $height);
            case 3: return new Point($this->x + $y, $bottom - $x - $width);
            default: return new Point($this->x + $x, $this->y + $y);
        }
    }