mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1193519 pt 6 - Adjust the position of the caret bidi indicator appropriately for sideways-lr mode. r=dholbert
This commit is contained in:
parent
ce8b369744
commit
8df83a2097
@ -925,7 +925,8 @@ nsCaret::ComputeCaretRects(nsIFrame* aFrame, int32_t aFrameOffset,
|
||||
{
|
||||
NS_ASSERTION(aFrame, "Should have a frame here");
|
||||
|
||||
bool isVertical = aFrame->GetWritingMode().IsVertical();
|
||||
WritingMode wm = aFrame->GetWritingMode();
|
||||
bool isVertical = wm.IsVertical();
|
||||
|
||||
nscoord bidiIndicatorSize;
|
||||
*aCaretRect = GetGeometryForFrame(aFrame, aFrameOffset, &bidiIndicatorSize);
|
||||
@ -957,11 +958,20 @@ nsCaret::ComputeCaretRects(nsIFrame* aFrame, int32_t aFrameOffset,
|
||||
}
|
||||
bool isCaretRTL = caretBidiLevel % 2;
|
||||
if (isVertical) {
|
||||
aHookRect->SetRect(aCaretRect->XMost() - bidiIndicatorSize,
|
||||
aCaretRect->y + (isCaretRTL ? bidiIndicatorSize * -1 :
|
||||
aCaretRect->height),
|
||||
aCaretRect->height,
|
||||
bidiIndicatorSize);
|
||||
bool isSidewaysLR = wm.IsVerticalLR() && !wm.IsLineInverted();
|
||||
if (isSidewaysLR) {
|
||||
aHookRect->SetRect(aCaretRect->x + bidiIndicatorSize,
|
||||
aCaretRect->y + (!isCaretRTL ? bidiIndicatorSize * -1 :
|
||||
aCaretRect->height),
|
||||
aCaretRect->height,
|
||||
bidiIndicatorSize);
|
||||
} else {
|
||||
aHookRect->SetRect(aCaretRect->XMost() - bidiIndicatorSize,
|
||||
aCaretRect->y + (isCaretRTL ? bidiIndicatorSize * -1 :
|
||||
aCaretRect->height),
|
||||
aCaretRect->height,
|
||||
bidiIndicatorSize);
|
||||
}
|
||||
} else {
|
||||
aHookRect->SetRect(aCaretRect->x + (isCaretRTL ? bidiIndicatorSize * -1 :
|
||||
aCaretRect->width),
|
||||
|
Loading…
Reference in New Issue
Block a user