Bug 1117227 part 4 - Make overflow mark baseline computation aware of writing-mode

This commit is contained in:
Xidorn Quan
2017-04-03 12:38:31 +02:00
committed by roytam1
parent 3c8d80395e
commit 07f4430218
+15 -4
View File
@@ -223,10 +223,21 @@ void
nsDisplayTextOverflowMarker::PaintTextToContext(nsRenderingContext* aCtx,
nsPoint aOffsetFromRect)
{
gfxFloat y = nsLayoutUtils::GetSnappedBaselineY(mFrame, aCtx->ThebesContext(),
mRect.y, mAscent);
nsPoint baselinePt(mRect.x, NSToCoordFloor(y));
nsPoint pt = baselinePt + aOffsetFromRect;
WritingMode wm = mFrame->GetWritingMode();
nsPoint pt(mRect.x, mRect.y);
if (wm.IsVertical()) {
if (wm.IsVerticalLR()) {
pt.x = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineX(
mFrame, aCtx->ThebesContext(), pt.x, mAscent));
} else {
pt.x = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineX(
mFrame, aCtx->ThebesContext(), pt.x + mRect.width, -mAscent));
}
} else {
pt.y = NSToCoordFloor(nsLayoutUtils::GetSnappedBaselineY(
mFrame, aCtx->ThebesContext(), pt.y, mAscent));
}
pt += aOffsetFromRect;
if (mStyle->mType == NS_STYLE_TEXT_OVERFLOW_ELLIPSIS) {
gfxTextRun* textRun = GetEllipsisTextRun(mFrame);