зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1827009 - Don't assume the textrun has necessarily been created already. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175108
This commit is contained in:
Родитель
0c01f97c31
Коммит
193a8ba340
|
@ -3032,14 +3032,15 @@ nscoord nsLineLayout::GetHangFrom(const PerSpanData* aSpan, bool aLineIsRTL) {
|
|||
return GetHangFrom(childSpan, aLineIsRTL);
|
||||
}
|
||||
if (pfd->mIsTextFrame) {
|
||||
const auto* lastText = static_cast<const nsTextFrame*>(pfd->mFrame);
|
||||
auto* lastText = static_cast<nsTextFrame*>(pfd->mFrame);
|
||||
result = lastText->GetHangableISize();
|
||||
if (result) {
|
||||
// If the hangable space will be at the start edge of the line, due to
|
||||
// its bidi direction being against the line direction, we flag this by
|
||||
// negating the advance.
|
||||
if (lastText->GetTextRun(nsTextFrame::eInflated)->IsRightToLeft() !=
|
||||
aLineIsRTL) {
|
||||
lastText->EnsureTextRun(nsTextFrame::eInflated);
|
||||
auto* textRun = lastText->GetTextRun(nsTextFrame::eInflated);
|
||||
if (textRun && textRun->IsRightToLeft() != aLineIsRTL) {
|
||||
result = -result;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче