public final function expandMaxSideTo( int $newMaxSideLength ) : bool
   {

      $this->triggerFixedErrorByNeed( 'expandMaxSideTo' );

      if ( $this->isPortrait() )
      {

         if ( $newMaxSideLength < $this->_height )
         {
            return false;
         }
         $resultPercent = ( 100 * $newMaxSideLength ) / $this->_height;
         $this->_width = \intval(
            \floor(
               ( $resultPercent * $this->_width ) / 100
            )
         );
         $this->_height = $newMaxSideLength;

      }
      else
      {

         if ( $newMaxSideLength < $this->_width )
         {
            return false;
         }
         $resultPercent = ( 100 * $newMaxSideLength ) / $this->_width;
         $this->_height = \intval(
            \floor(
               ( $resultPercent * $this->_height ) / 100
            )
         );
         $this->_width = $newMaxSideLength;

      }

      return true;

   }
public final function expandMaxSideTo( int $newMaxSideLength ) : bool
   {

      $this->triggerFixedErrorByNeed( 'expandMaxSideTo' );

      if ( $this->isPortrait() )
      {

         if ( $newMaxSideLength < $this->_height )
         {
            return false;
         }
         $resultPercent = ( 100 * $newMaxSideLength ) / $this->_height;
         $this->_width = \intval(
            \floor(
               ( $resultPercent * $this->_width ) / 100
            )
         );
         $this->_height = $newMaxSideLength;

      }
      else
      {

         if ( $newMaxSideLength < $this->_width )
         {
            return false;
         }
         $resultPercent = ( 100 * $newMaxSideLength ) / $this->_width;
         $this->_height = \intval(
            \floor(
               ( $resultPercent * $this->_height ) / 100
            )
         );
         $this->_width = $newMaxSideLength;

      }

      return true;

   }
public final function expandMaxSideTo ( int $ newMaxSideLength ) : bool { $ this -> triggerFixedErrorByNeed ( 'expandMaxSideTo' ) ; if ( $ this -> isPortrait ( ) ) { if ( $ newMaxSideLength < $ this -> _height ) { return false ; } $ resultPercent = ( 100 * $ newMaxSideLength ) / $ this -> _height ; $ this -> _width = \ intval ( \ floor ( ( $ resultPercent * $ this -> _width ) / 100 ) ) ; $ this -> _height = $ newMaxSideLength ; } else { if ( $ newMaxSideLength < $ this -> _width ) { return false ; } $ resultPercent = ( 100 * $ newMaxSideLength ) / $ this -> _width ; $ this -> _height = \ intval ( \ floor ( ( $ resultPercent * $ this -> _height ) / 100 ) ) ; $ this -> _width = $ newMaxSideLength ; } return true ; }
Expands the longest side to the defined length and also expands the shorter side to hold the proportion
of this size. If the current size defines a quadratic size, its also expanded but without searching the
longer side.

@param  integer $newMaxSideLength
@return boolean TRUE on success, or FALSE if longest side is already longer than $newMaxSideLength.
@throws \Beluga\BelugaError  If the instance is set to fixed.
Expands the longest side to the defined length and also expands the shorter side to hold the proportion of this size . If the current size defines a quadratic size its also expanded but without searching the longer side .