Creates a quadratic copy of the specified
{@link \Jdenticon\Rendering\Rectangle} with a multiple of the cell count
as size.

@param \Jdenticon\Rendering\Rectangle $rect The rectangle to be
normalized.
435106
protected function normalizeRectangle(\Jdenticon\Rendering\Rectangle $rect)
    {
        $size = (int)min($rect->width, $rect->height);
        
        // Make size a multiple of the cell count
        $size -= $size % $this->getCellCount();
        
        return new Rectangle(
            (int)($rect->x + ($rect->width - $size) / 2),
            (int)($rect->y + ($rect->height - $size) / 2),
            $size,
            $size);
    }
1297426
function (x, y, width, height) {
    return new BVG('rect', x.constructor.name === 'Object' ? x : {
      x: x,
      y: y,
      width: width,
      height: height
    });
  }
1336837
def rectangle(self, rect, attr=None, fill=u' '):
        '''
        x0, y0, x1, y1 = rect
        n = DWORD(0)
        if attr is None:
            attr = self.attr
        for y in range(y0, y1):
            pos = self.fixcoord(x0, y)
            self.FillConsoleOutputAttribute(self.hout, attr, x1 - x0, 
                                            pos, byref(n))
            self.FillConsoleOutputCharacterW(self.hout, ord(fill[0]), x1 - x0,
                                             pos, byref(n))
1294657
function filledRectangle($x1, $y1, $width, $height) {
    $this->objects[$this->currentContents]['c'].=  sprintf("\n%.3F %.3F %.3F %.3F re f", $x1, $y1, $width, $height);
  }
81510
private function createImage($matrixContent)
    {
        $maskNumber     = $this->getMaskNumber($matrixContent);
        $maskContent    = 1 << $maskNumber;

        $mib = $this->getMaxModulesOneSide() + 8;

        if ( $this->getSize() == 0 ) {
            $this->setSize($mib * $this->getModuleSize());

            if ( $this->getSize() > 1480 ) {
                throw new ImageSizeTooLargeException('QRCode : Image size too large');
            }
        }

        $this->image    = imagecreate($this->size + $this->padding * 2, $this->size + $this->padding * 2);
        imagecolorallocate($this->image, 255, 255, 255);

        $baseImage      = imagecreatefrompng($this->getImagePath() . "/qrv" . $this->getVersion() . ".png");

        // Foreground Color
        $col[1]         = imagecolorallocate($baseImage, $this->frontDefaultColor->getRed(), $this->frontDefaultColor->getGreen(), $this->frontDefaultColor->getBlue());
        // Background Color
        $col[0]         = imagecolorallocate($baseImage, $this->backDefaultColor->getRed(), $this->backDefaultColor->getGreen(), $this->backDefaultColor->getBlue());

        $mxe    = 4 + $this->getMaxModulesOneSide();
        $i      = 4;
        $ii     = 0;

        while ($i < $mxe) {
            $j  = 4; $jj = 0;

            while ($j < $mxe) {
                if ($matrixContent[$ii][$jj] & $maskContent) {
                    imagesetpixel($baseImage, $i, $j, $col[1]);
                }

                $j++; $jj++;
            }

            $i++; $ii++;
        }

        imagecopyresampled($this->image, $baseImage, $this->padding, $this->padding, 4, 4, $this->size, $this->size, $mib - 8, $mib - 8);

        if ( ! is_null($this->backColor) ) {
            $this->colorifyImage($this->backDefaultColor, $this->backColor);
        }

        if ( ! is_null($this->frontColor) ) {
            $this->colorifyImage($this->frontDefaultColor, $this->frontColor);
        }
    }
1172876
public function getCell($pCoordinate = 'A1')
    {
        // Check cell collection
        if ($this->cellCollection->isDataSet(strtoupper($pCoordinate))) {
            return $this->cellCollection->getCacheData($pCoordinate);
        }

        // Worksheet reference?
        if (strpos($pCoordinate, '!') !== false) {
            $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
            return $this->parent->getSheetByName($worksheetReference[0])->getCell(strtoupper($worksheetReference[1]));
        }

        // Named range?
        if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
            (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
            $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
            if ($namedRange !== null) {
                $pCoordinate = $namedRange->getRange();
                return $namedRange->getWorksheet()->getCell($pCoordinate);
            }
        }

        // Uppercase coordinate
        $pCoordinate = strtoupper($pCoordinate);

        if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
            throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.');
        } elseif (strpos($pCoordinate, '$') !== false) {
            throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
        }

        // Create new cell object
        return $this->createNewCell($pCoordinate);
    }
461100
def rectangle(self, x0, y0, x1, y1):
        """"""
        x0, y0, x1, y1 = self.rect_helper(x0, y0, x1, y1)
        self.polyline([[x0, y0], [x1, y0], [x1, y1], [x0, y1], [x0, y0]])
206310
public Rectangle getRect() {
        verifyPropertyPresence(RECT);
        //noinspection unchecked
        return mapToRect((Map<String, Object>) getCommandResult().get(RECT));
    }
980522
public function getCell($pCoordinate = 'A1')
    {
        // Check cell collection
        if ($this->_cellCollection->isDataSet($pCoordinate)) {
            return $this->_cellCollection->getCacheData($pCoordinate);
        }

        // Worksheet reference?
        if (strpos($pCoordinate, '!') !== false) {
            $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
			return $this->_parent->getSheetByName($worksheetReference[0])->getCell($worksheetReference[1]);
        }

        // Named range?
        if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
            (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
            $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
            if ($namedRange !== NULL) {
                $pCoordinate = $namedRange->getRange();
                return $namedRange->getWorksheet()->getCell($pCoordinate);
            }
        }

        // Uppercase coordinate
        $pCoordinate = strtoupper($pCoordinate);

        if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
            throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.');
        } elseif (strpos($pCoordinate, '$') !== false) {
            throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
        }

        // Create new cell object
        return $this->_createNewCell($pCoordinate);
    }
1139981
public void moveRectangleTo(Rectangle rect, float x, float y) {
		float width = rect.getWidth();
		float height = rect.getHeight();
		rect.setLeft(x);
		rect.setBottom(y);
		rect.setRight(rect.getLeft() + width);
		rect.setTop(rect.getBottom() + height);
	}
1034681
function(rectangle) {
        return $.Rect.fromSummits(
            this.pixelFromPoint(rectangle.getTopLeft(), true),
            this.pixelFromPoint(rectangle.getTopRight(), true),
            this.pixelFromPoint(rectangle.getBottomLeft(), true)
        );
    }
381322
public Rectangle toRelative(Rectangle rect) {
		return new Rectangle(rect.getLeft() - origX, rect.getBottom() - origY, rect.getRight() - origX, rect.getTop()
				- origY);
	}
592526
private static RoundRectangle2D.Double toRoundRect(final Rectangle2D pRectangle, final int pArcW, final int pArcH) {
        return new RoundRectangle2D.Double(
                pRectangle.getX(), pRectangle.getY(),
                pRectangle.getWidth(), pRectangle.getHeight(),
                pArcW, pArcH);
    }
910487
function(angle) {

            if (!angle) return this.clone();

            var theta = toRad(angle);
            var st = abs(sin(theta));
            var ct = abs(cos(theta));
            var w = this.width * ct + this.height * st;
            var h = this.width * st + this.height * ct;
            return new Rect(this.x + (this.width - w) / 2, this.y + (this.height - h) / 2, w, h);
        }
578273
public final void setRect(double xMin, double xMax, double yMin, double yMax)
    {
        setRect(new Rectangle2D.Double(xMin, yMin, xMax-xMin, yMax-yMin));
    }
449881
public static function setTextAreaSize($options)
    {
        if (isset($options['size'])) {
            return self::setQuickTextAreaSize($options);
        }

        $cols = array_get($options, 'cols', 50);
        $rows = array_get($options, 'rows', 10);

        return array_merge($options, compact('cols', 'rows'));
    }
834113
public void addDescriptor( boolean positive , ImageRectangle rect ) {

		addDescriptor(positive, rect.x0, rect.y0, rect.x1, rect.y1);
	}