示例#1
0
文件: Text.php 项目: hungnv0789/vhtm
 /**
 * Right boundary of the background fill area 
 * @return int Rightmost position on the canvas
  * @access private
 */
 function _fillRight()
 {
     if ($this->_alignment & IMAGE_GRAPH_ALIGN_RIGHT) {
         return $this->_left;
     }
     if ($this->_alignment & IMAGE_GRAPH_ALIGN_CENTER_X) {
         return $this->_left + $this->_font->_centerWidth($this->_text);
     } else {
         return $this->_left + $this->_font->width($this->_text);
     }
 }
示例#2
0
    /**
     * Output the text 
     * @access private
     */
    function _done()
    {
        if (!$this->_font) {
            return false;
        }
        
        if (!is_a($this->_parent, "Image_Graph_Layout")) {
            $this->_setCoords(
                $this->_parent->_fillLeft(),
                $this->_parent->_fillTop(),
                $this->_parent->_fillRight(),
                $this->_parent->_fillTop() + $this->_font->height($this->_text)
            );
        }               
        
        parent::_done();

        $this->_font->_write(
            ($this->_left + $this->_right - $this->_font->width($this->_text)) / 2, 
            ($this->_top + $this->_bottom - $this->_font->height($this->_text)) / 2, 
            $this->_text
        );
    }