mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1415214 - (Part 1) Fix the bound of the clip rect for drawing decoration lines. r=jfkthame
MozReview-Commit-ID: KoDvzqaCSGB
This commit is contained in:
parent
2a3257bb20
commit
d9b8b8aa04
@ -7285,19 +7285,24 @@ nsTextFrame::DrawTextRunAndDecorations(Range aRange,
|
||||
if (!skipClipping) {
|
||||
// Get the inline-size according to the specified range.
|
||||
gfxFloat clipLength = mTextRun->GetAdvanceWidth(aRange, aParams.provider);
|
||||
|
||||
clipRect.width = verticalDec ? frameSize.width : clipLength / app;
|
||||
clipRect.height = verticalDec ? clipLength / app : frameSize.height;
|
||||
nsRect visualRect = GetVisualOverflowRect();
|
||||
|
||||
const bool isInlineReversed = mTextRun->IsInlineReversed();
|
||||
if (verticalDec) {
|
||||
clipRect.y = (isInlineReversed ? aTextBaselinePt.y - clipLength
|
||||
: aTextBaselinePt.y) / app;
|
||||
clipRect.x = aParams.framePt.x + visualRect.x;
|
||||
clipRect.y = isInlineReversed ? aTextBaselinePt.y - clipLength
|
||||
: aTextBaselinePt.y;
|
||||
clipRect.width = visualRect.width;
|
||||
clipRect.height = clipLength;
|
||||
} else {
|
||||
clipRect.x = (isInlineReversed ? aTextBaselinePt.x - clipLength
|
||||
: aTextBaselinePt.x) / app;
|
||||
clipRect.x = isInlineReversed ? aTextBaselinePt.x - clipLength
|
||||
: aTextBaselinePt.x;
|
||||
clipRect.y = aParams.framePt.y + visualRect.y;
|
||||
clipRect.width = clipLength;
|
||||
clipRect.height = visualRect.height;
|
||||
}
|
||||
|
||||
clipRect.Scale(1 / app);
|
||||
clipRect.Round();
|
||||
params.context->Clip(clipRect);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user