Example #1
0
 /**
  * Function: getLabelPaintBounds
  * 
  * Returns the paint bounds for the given label.
  */
 static function getLabelPaintBounds($label, $style, $isHtml, $offset, $vertexBounds, $scale)
 {
     $size = mxUtils::getLabelSize($label, $style);
     $x = $offset->x;
     $y = $offset->y;
     $width = 0;
     $height = 0;
     if (isset($vertexBounds)) {
         $x += $vertexBounds->x;
         $y += $vertexBounds->y;
         if (mxUtils::getValue($style, mxConstants::$STYLE_SHAPE, "") == mxConstants::$SHAPE_SWIMLANE) {
             // Limits the label to the swimlane title
             $start = mxUtils::getNumber($style, mxConstants::$STYLE_STARTSIZE, mxConstants::$DEFAULT_STARTSIZE) * $scale;
             if (mxUtils::getValue($style, mxConstants::$STYLE_HORIZONTAL, true)) {
                 $width += $vertexBounds->width;
                 $height += $start;
             } else {
                 $width += $start;
                 $height += $vertexBounds->height;
             }
         } else {
             $height += $vertexBounds->height;
             $width += $vertexBounds->width;
         }
     }
     return mxUtils::getScaledLabelBounds($x, $y, $size, $width, $height, $style, $scale);
 }