コード例 #1
0
ファイル: IdmlBoundary.php プロジェクト: skypeter1/webapps
 /**
  * Returns the height of the offset attribute for a rotated element.
  * Using this height, we'll construct a div before and after the rotated element
  * @param IdmlElement $element
  * @return string
  */
 public static function getOffsetHeight(IdmlElement $element)
 {
     $containingBoundary = new IdmlBoundary($element->boundary->top, $element->boundary->left, $element->boundary->bottom, $element->boundary->right);
     $containingBoundary->rotate($element->transformation->getB());
     $elementHeight = $element->boundary->getHeight();
     $containerHeight = $containingBoundary->getHeight();
     $offsetHeight = ($containerHeight - $elementHeight) / 2;
     if ($offsetHeight < 0) {
         $offsetHeight = 0;
     }
     return $offsetHeight;
 }