// the curve shapes listen to curve events
// !lastPoints.equals(curve.getGuidePoints())
for (int j = 0; j < label.length(); j++)
{
mxLine parallel = curve.getCurveParallel(mxCurve.LABEL_CURVE,
currentPos);
labelGlyphs[j].glyphVector = parallel;
labelGlyphs[j].labelGlyphBounds.setX(parallel.getX());
labelGlyphs[j].labelGlyphBounds.setY(parallel.getY());
// Hook for sub-classers
postprocessGlyph(curve, j, currentPos);
currentPos += (labelGlyphs[j].labelGlyphBounds.getWidth() + labelPosition.defaultInterGlyphSpace)
/ curveLength;
if (overallLabelBounds == null)
{
overallLabelBounds = (mxRectangle) labelGlyphs[j].labelGlyphBounds
.clone();
}
else
{
overallLabelBounds.add(labelGlyphs[j].labelGlyphBounds);
}
}
if (overallLabelBounds == null)
{
// Return a small rectangle in the center of the label curve
// Null label bounds causes NPE when editing
mxLine labelCenter = curve.getCurveParallel(mxCurve.LABEL_CURVE,
0.5);
overallLabelBounds = new mxRectangle(labelCenter.getX(),
labelCenter.getY(), 1, 1);
}
this.labelBounds = overallLabelBounds;
return overallLabelBounds;
}