Output/Element.php
/**
     * Calculates start col from element style settings.
     *
     * @param int $len
     * @param int $width
     * @param int $offset
     * @access protected
     * @return int
     */
Calculates start col from element style settings.
Calculates start col from element style settings .
protected function _getStartCol($len, $width)
    {
        $align  = $this->getStyle('text-align');
        $valid  = array('left', 'right', 'center');
        $offset = $this->_getHOff($width);
        if (!$align || !in_array($align, $valid)) {
            $align = 'left';
        }
        switch ($align) {
            case 'left':
                $col = $offset;
                break;
            case 'center':
                $col = $offset + floor($width / 2 - $len / 2);
                break;
            case 'right':
                $col = $offset + $width - $len;
                break;
        }
        return $col;
    }
protected function _getStartCol ( $ len , $ width ) { $ align = $ this -> getStyle ( 'text-align' ) ; $ valid = array ( 'left' , 'right' , 'center' ) ; $ offset = $ this -> _getHOff ( $ width ) ; if ( ! $ align || ! in_array ( $ align , $ valid ) ) { $ align = 'left' ; } switch ( $ align ) { case 'left' : $ col = $ offset ; break ; case 'center' : $ col = $ offset + floor ( $ width / 2 - $ len / 2 ) ; break ; case 'right' : $ col = $ offset + $ width - $ len ; break ; } return $ col ; }
Calculates start col from element style settings.
Calculates start col from element style settings .