mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Add inflation parameter to nsLayoutUtils::GetFontMetricsFor* methods. (Bug 627842, patch 6) r=roc
This commit is contained in:
parent
2ae2d74942
commit
aa9ba3f977
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user