зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1226627 - Truncate the result in ZoomText/UnZoomText rather than rounding it for better performance. r=roc
This commit is contained in:
Родитель
0a25bbf702
Коммит
4e20c0f6c8
|
@ -203,7 +203,7 @@ nsStyleFont::ZoomText(nsPresContext *aPresContext, nscoord aSize)
|
|||
{
|
||||
// aSize can be negative (e.g.: calc(-1px)) so we can't assert that here.
|
||||
// The caller is expected deal with that.
|
||||
return NSCoordSaturatingMultiply(aSize, aPresContext->TextZoom());
|
||||
return NSToCoordTruncClamped(float(aSize) * aPresContext->TextZoom());
|
||||
}
|
||||
|
||||
/* static */ nscoord
|
||||
|
@ -211,7 +211,7 @@ nsStyleFont::UnZoomText(nsPresContext *aPresContext, nscoord aSize)
|
|||
{
|
||||
// aSize can be negative (e.g.: calc(-1px)) so we can't assert that here.
|
||||
// The caller is expected deal with that.
|
||||
return NSCoordSaturatingMultiply(aSize, 1.0 / aPresContext->TextZoom());
|
||||
return NSToCoordTruncClamped(float(aSize) / aPresContext->TextZoom());
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<nsIAtom>
|
||||
|
|
Загрузка…
Ссылка в новой задаче