зеркало из https://github.com/mozilla/gecko-dev.git
Add inflation parameter to nsLayoutUtils::GetFontMetricsFor* methods. (Bug 627842, patch 6) r=roc
This commit is contained in:
Родитель
b5f3e65d17
Коммит
c8a116a10b
|
@ -1928,22 +1928,26 @@ nsLayoutUtils::GetTextShadowRectsUnion(const nsRect& aTextAndDecorationsRect,
|
|||
|
||||
nsresult
|
||||
nsLayoutUtils::GetFontMetricsForFrame(const nsIFrame* aFrame,
|
||||
nsFontMetrics** aFontMetrics)
|
||||
nsFontMetrics** aFontMetrics,
|
||||
float aInflation)
|
||||
{
|
||||
return nsLayoutUtils::GetFontMetricsForStyleContext(aFrame->GetStyleContext(),
|
||||
aFontMetrics);
|
||||
aFontMetrics,
|
||||
aInflation);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLayoutUtils::GetFontMetricsForStyleContext(nsStyleContext* aStyleContext,
|
||||
nsFontMetrics** aFontMetrics)
|
||||
nsFontMetrics** aFontMetrics,
|
||||
float aInflation)
|
||||
{
|
||||
// pass the user font set object into the device context to pass along to CreateFontGroup
|
||||
gfxUserFontSet* fs = aStyleContext->PresContext()->GetUserFontSet();
|
||||
|
||||
nsFont font = aStyleContext->GetStyleFont()->mFont;
|
||||
font.size = NSToCoordRound(font.size * aInflation);
|
||||
return aStyleContext->PresContext()->DeviceContext()->GetMetricsFor(
|
||||
aStyleContext->GetStyleFont()->mFont,
|
||||
aStyleContext->GetStyleVisibility()->mLanguage,
|
||||
font, aStyleContext->GetStyleVisibility()->mLanguage,
|
||||
fs, *aFontMetrics);
|
||||
}
|
||||
|
||||
|
|
|
@ -742,19 +742,23 @@ public:
|
|||
* Get the font metrics corresponding to the frame's style data.
|
||||
* @param aFrame the frame
|
||||
* @param aFontMetrics the font metrics result
|
||||
* @param aSizeInflation number to multiply font size by
|
||||
* @return success or failure code
|
||||
*/
|
||||
static nsresult GetFontMetricsForFrame(const nsIFrame* aFrame,
|
||||
nsFontMetrics** aFontMetrics);
|
||||
nsFontMetrics** aFontMetrics,
|
||||
float aSizeInflation = 1.0f);
|
||||
|
||||
/**
|
||||
* Get the font metrics corresponding to the given style data.
|
||||
* @param aStyleContext the style data
|
||||
* @param aFontMetrics the font metrics result
|
||||
* @param aSizeInflation number to multiply font size by
|
||||
* @return success or failure code
|
||||
*/
|
||||
static nsresult GetFontMetricsForStyleContext(nsStyleContext* aStyleContext,
|
||||
nsFontMetrics** aFontMetrics);
|
||||
nsFontMetrics** aFontMetrics,
|
||||
float aSizeInflation = 1.0f);
|
||||
|
||||
/**
|
||||
* Find the immediate child of aParent whose frame subtree contains
|
||||
|
|
Загрузка…
Ссылка в новой задаче