Fix negative bounds height on PointText.

This commit is contained in:
Jürg Lehni 2013-06-12 19:21:46 -07:00
parent 2196ef2a74
commit 463a00bd1e

View file

@ -108,11 +108,11 @@ var PointText = TextItem.extend(/** @lends PointText# */{
// Adjust for different justifications // Adjust for different justifications
if (justification !== 'left') if (justification !== 'left')
x -= width / (justification === 'center' ? 2: 1); x -= width / (justification === 'center' ? 2: 1);
// Until we don't have baseline measuring, assume leading / 4 as a // Until we don't have baseline measuring, assume 1 / 4 leading as a
// rough guess: // rough guess:
var bounds = new Rectangle(x, var bounds = new Rectangle(x,
count ? leading / 4 + (count - 1) * leading : 0, count ? - 0.75 * leading : 0,
width, -count * leading); width, count * leading);
return matrix ? matrix._transformBounds(bounds, bounds) : bounds; return matrix ? matrix._transformBounds(bounds, bounds) : bounds;
} }
}; };