public function clearRect($x, $y, $width, $height) 
    {
        $fullCanvas = false;

        if (!$this->transform->hasSkewing()) {
            // Check if the whole canvas is cleared
            $topLeft = $this->transform->multiplyPoint($x, $y);
            if ($topLeft->x <= 0 && $topLeft->y <= 0) {
                $bottomRight = $this->transform->multiplyPoint(
                    $x + $width, $y + $height);
                if ($bottomRight->x >= $this->canvas->width &&
                    $bottomRight->y >= $this->canvas->height
                ) {
                    $fullCanvas = true;
                }
            }
        }

        if ($fullCanvas) {
            $this->edges->clear();
        } else {
            $this->_fillRect(ColorUtils::FORCE_TRANSPARENT, 
                $x, $y, $width, $height);
        }
    }