Set size

set new width and height for the current dimension using the width and
the hight of the passed dimension

@param \Jaguar\Dimension $dimension

@return \Jaguar\Dimension
498430
public function setSize(Dimension $dimension)
    {
        return $this->setWidth($dimension->getWidth())
                        ->setHeight($dimension->getHeight());
    }
57135
public function scale($ratio)
    {
        $this->getDimension()
                ->setWidth(
                        round($ratio * $this->getDimension()->getWidth())
                )->setHeight(
                round($ratio * $this->getDimension()->getHeight())
        );

        return $this;
    }
980935
public function resize_max( $width, $height ) 
	{
		$new_width = $this->width;
		$new_height = $this->height;

		if ( $new_width > $width ) 
		{
			// set new with
			$new_width = $width;
			// calculate height
			$new_height = $new_width * ( $this->height / $this->width );
		}

		if ( $new_height > $height ) 
		{
			// set new height
			$new_height = $height;
			// calculate width
			$new_width = $new_height * ( $this->width / $this->height );
		}

		return $this->resize_strict( $new_width, $new_height );
	}
515903
public function changeWindowSize(int $width = 1024, int $height = 768)
    {
        $this->wd->manage()->window()->setPosition(new WebDriverPoint($width, $height));

        return $this;
    }
398815
public function resize($width, $height) {
        if ($width && $height) $this->thumb->resize($width, $height);
        else if (!$width) $this->thumb->resize(99999, $height);
        else if (!$height) $this->thumb->resize($width, 99999);
        return $this;
    }
960492
public function add($width, $height=null)
    {
        if ($width instanceof Size) {
            $height = $width->height();
            $width = $width->width();
        }

        $height = $height ? $height : $width;

        return new static($this->width()+$width, $this->height()+$height);
    }
1149850
public function setSize($size)
    {
        if (strpos($size, 'col-') === false) {
            $size = 'col-'.$size.'-';
        }

        $this->size = $size;

        return $this;
    }
647796
public function setHeight($height)
    {
        $height = $this->convertUnit($height);
        $this->setAttributeDirectly('height', $height);

        return $this;
    }
761502
public function fit_to_height($height)
    {
        $aspect_ratio = $this->height / $this->width;
        $width = $height / $aspect_ratio;

        return $this->resize($width, $height);
    }
8900
protected function updateDimensions()
  {
    $this->width  = $this->image ? imagesx($this->image) : null;
    $this->height = $this->image ? imagesy($this->image) : null;

    return $this;
  }
229141
public function setSize($size)
    {
        $this->getColumns()->each(function (ColumnInterface $column) use ($size) {
            $column->setSize($size);
        });
    }
208524
public static function getForDimension(Dimension $dimension)
    {
        $provider = new ReportsProvider();
        $reports = $provider->getAllReports();
        foreach ($reports as $report) {
            if (!$report->isSubtableReport()
                && $report->getDimension()
                && $report->getDimension()->getId() == $dimension->getId()
            ) {
                return $report;
            }
        }
        return null;
    }
347218
public function setWidth($width){
		if(\is_int($width)){
			$width=Wide::getConstants()["W".$width];
		}
		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
		if(isset($this->_container)){
			$this->_container->setEqualWidth(false);
		}
		return $this->addToPropertyCtrl("class", "wide",array("wide"));
	}
282232
public function set_window_size( $width, $height )
	{
		$width = $this->replace_variables( $width );
		$height = $this->replace_variables( $height );

		$this->getSession()->getDriver()->resizeWindow( $width, $height, 'current' );
	}
216907
public static function getProvisionalVersionForDimension(int $dimension) : self
    {
        if (1 !== $dimension % 4) {
            throw new InvalidArgumentException('Dimension is not 1 mod 4');
        }

        return self::getVersionForNumber(intdiv($dimension - 17, 4));
    }
366247
public function setVideoDimension($height, $width)
    {
        $this->propertyList['video:height']    = $height;
        $this->propertyList['video:width']     = $width;

        return $this;
    }
669641
public function multiply($width, $height=null)
    {
        if ($width instanceof Size) {
            $height = $width->height();
            $width = $width->width();
        }

        $height = $height ? $height : $width;

        return new static($this->width()*$width, $this->height()*$height);
    }