示例#1
0
 /**
  * Calculates the real width of the pad
  */
 protected function calculatePadRealSize()
 {
     // when retrieving width, the width of the expanded version is retrieved.
     // string type may have a collapsed version longer than its expanded version
     $this->expandAll($this->var);
     $expandedWidth = max($this->var->getStringWidth(), $this->var->getChildrenWidth(true));
     $this->var->collapse(true);
     $collapsedWidth = max($this->var->getStringWidth(), $this->var->getChildrenWidth(true));
     $this->padRealWidth = max($collapsedWidth, $expandedWidth);
 }