mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 365414 overflowed decoration lines are not erased/painted r+sr=roc
This commit is contained in:
parent
051a23c4b6
commit
e2f6a778c9
@ -347,7 +347,9 @@ gfxFont::Measure(gfxTextRun *aTextRun,
|
|||||||
metrics.mAdvanceWidth = floatAdvance;
|
metrics.mAdvanceWidth = floatAdvance;
|
||||||
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||||
metrics.mAscent = fontMetrics.maxAscent*appUnitsPerDevUnit;
|
metrics.mAscent = fontMetrics.maxAscent*appUnitsPerDevUnit;
|
||||||
metrics.mDescent = fontMetrics.maxDescent*appUnitsPerDevUnit;
|
gfxFloat descentForUnderline =
|
||||||
|
NS_round(fontMetrics.underlineSize) + NS_round(metrics.mAscent - fontMetrics.underlineOffset) - metrics.mAscent;
|
||||||
|
metrics.mDescent = PR_MAX(fontMetrics.maxDescent, descentForUnderline)*appUnitsPerDevUnit;
|
||||||
metrics.mBoundingBox =
|
metrics.mBoundingBox =
|
||||||
gfxRect(0, -metrics.mAscent, floatAdvance, metrics.mAscent + metrics.mDescent);
|
gfxRect(0, -metrics.mAscent, floatAdvance, metrics.mAscent + metrics.mDescent);
|
||||||
return metrics;
|
return metrics;
|
||||||
|
@ -518,6 +518,9 @@ public:
|
|||||||
float AppUnitsToPoints(nscoord aAppUnits) const
|
float AppUnitsToPoints(nscoord aAppUnits) const
|
||||||
{ return (float)aAppUnits / mDeviceContext->AppUnitsPerInch() * 72.0f; }
|
{ return (float)aAppUnits / mDeviceContext->AppUnitsPerInch() * 72.0f; }
|
||||||
|
|
||||||
|
nscoord RoundAppUnitsToNearestDevPixels(nscoord aAppUnits) const
|
||||||
|
{ return DevPixelsToAppUnits(AppUnitsToDevPixels(aAppUnits)); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the language-specific transform type for the current document.
|
* Get the language-specific transform type for the current document.
|
||||||
* This tells us whether we need to perform special language-dependent
|
* This tells us whether we need to perform special language-dependent
|
||||||
|
@ -559,6 +559,15 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||||||
// affect our height.
|
// affect our height.
|
||||||
fm->GetMaxAscent(aMetrics.ascent);
|
fm->GetMaxAscent(aMetrics.ascent);
|
||||||
fm->GetHeight(aMetrics.height);
|
fm->GetHeight(aMetrics.height);
|
||||||
|
// Include the text-decoration lines to the height.
|
||||||
|
// Currently, only undeline is overflowable.
|
||||||
|
nscoord offset, size;
|
||||||
|
fm->GetUnderline(offset, size);
|
||||||
|
nscoord ascentAndUnderline =
|
||||||
|
aPresContext->RoundAppUnitsToNearestDevPixels(aMetrics.ascent - offset) +
|
||||||
|
aPresContext->RoundAppUnitsToNearestDevPixels(size);
|
||||||
|
if (ascentAndUnderline > aMetrics.height)
|
||||||
|
aMetrics.height = ascentAndUnderline;
|
||||||
} else {
|
} else {
|
||||||
NS_WARNING("Cannot get font metrics - defaulting sizes to 0");
|
NS_WARNING("Cannot get font metrics - defaulting sizes to 0");
|
||||||
aMetrics.ascent = aMetrics.height = 0;
|
aMetrics.ascent = aMetrics.height = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user