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);
        }
    }
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);
        }
    }
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 ) ; } }
Fills the specified rectangle with fully transparent black without
affecting the current paths.

@param float $x X coordinate of the left side of the rectangle.
@param float $y Y coordinate of the top of the rectangle.
@param float $width Width of the rectangle.
@param float $height Height of the rectangle.
Fills the specified rectangle with fully transparent black without affecting the current paths .