Bug 1117227 part 3 - Make nsTextFrame::MeasureCharClippedText use frame isize instead of width. r=roc

--HG--
extra : source : 235e6a1f915ea38fd4dc9c966d3a619bca6b3e59
This commit is contained in:
Xidorn Quan 2015-04-24 10:15:32 +12:00
Родитель cb03df0c0b
Коммит 065df6bd63
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -6008,7 +6008,7 @@ nsTextFrame::MeasureCharClippedText(PropertyProvider& aProvider,
uint32_t offset = *aStartOffset;
uint32_t maxLength = *aMaxLength;
const nscoord frameWidth = GetSize().width;
const nscoord frameISize = ISize();
const bool rtl = mTextRun->IsRightToLeft();
gfxFloat advanceWidth = 0;
const nscoord startEdge = rtl ? aRightEdge : aLeftEdge;
@ -6032,7 +6032,7 @@ nsTextFrame::MeasureCharClippedText(PropertyProvider& aProvider,
const nscoord endEdge = rtl ? aLeftEdge : aRightEdge;
if (endEdge > 0) {
const gfxFloat maxAdvance = gfxFloat(frameWidth - endEdge);
const gfxFloat maxAdvance = gfxFloat(frameISize - endEdge);
while (maxLength > 0) {
uint32_t clusterLength =
GetClusterLength(mTextRun, offset, maxLength, rtl);
@ -6048,7 +6048,7 @@ nsTextFrame::MeasureCharClippedText(PropertyProvider& aProvider,
}
maxLength = offset - *aStartOffset;
nscoord* snappedEndEdge = rtl ? aSnappedLeftEdge : aSnappedRightEdge;
*snappedEndEdge = NSToCoordFloor(gfxFloat(frameWidth) - advanceWidth);
*snappedEndEdge = NSToCoordFloor(gfxFloat(frameISize) - advanceWidth);
}
*aMaxLength = maxLength;
return maxLength != 0;