mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 17:38:36 +00:00
#128394 Cursor position widely off from actual text when selection is made.
Taking langGroup into consideration when selecting font for text selection, it should be consistent with the way of rendering text. r=rbs, sr=attinasi, a=asa, adt
This commit is contained in:
parent
969eb059d1
commit
4e99a38eeb
@ -3400,9 +3400,17 @@ nsTextFrame::GetPosition(nsIPresContext* aCX,
|
||||
GetStyleContext(&styleContext);
|
||||
const nsStyleFont *font = (const nsStyleFont*)
|
||||
styleContext->GetStyleData(eStyleStruct_Font);
|
||||
const nsStyleVisibility* visibility = (const nsStyleVisibility*)
|
||||
styleContext->GetStyleData(eStyleStruct_Visibility);
|
||||
NS_RELEASE(styleContext);
|
||||
nsCOMPtr<nsIAtom> langGroup;
|
||||
if (visibility && visibility->mLanguage) {
|
||||
visibility->mLanguage->GetLanguageGroup(getter_AddRefs(langGroup));
|
||||
}
|
||||
nsCOMPtr<nsIFontMetrics> fm;
|
||||
aCX->GetMetricsFor(font->mFont, getter_AddRefs(fm));
|
||||
nsCOMPtr<nsIDeviceContext> dx;
|
||||
aCX->GetDeviceContext(getter_AddRefs(dx));
|
||||
dx->GetMetricsFor(font->mFont, langGroup, *getter_AddRefs(fm));
|
||||
acx->SetFont(fm);
|
||||
|
||||
// Get the renderable form of the text
|
||||
|
@ -3400,9 +3400,17 @@ nsTextFrame::GetPosition(nsIPresContext* aCX,
|
||||
GetStyleContext(&styleContext);
|
||||
const nsStyleFont *font = (const nsStyleFont*)
|
||||
styleContext->GetStyleData(eStyleStruct_Font);
|
||||
const nsStyleVisibility* visibility = (const nsStyleVisibility*)
|
||||
styleContext->GetStyleData(eStyleStruct_Visibility);
|
||||
NS_RELEASE(styleContext);
|
||||
nsCOMPtr<nsIAtom> langGroup;
|
||||
if (visibility && visibility->mLanguage) {
|
||||
visibility->mLanguage->GetLanguageGroup(getter_AddRefs(langGroup));
|
||||
}
|
||||
nsCOMPtr<nsIFontMetrics> fm;
|
||||
aCX->GetMetricsFor(font->mFont, getter_AddRefs(fm));
|
||||
nsCOMPtr<nsIDeviceContext> dx;
|
||||
aCX->GetDeviceContext(getter_AddRefs(dx));
|
||||
dx->GetMetricsFor(font->mFont, langGroup, *getter_AddRefs(fm));
|
||||
acx->SetFont(fm);
|
||||
|
||||
// Get the renderable form of the text
|
||||
|
Loading…
x
Reference in New Issue
Block a user