mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1226627 - Truncate the result in ZoomText/UnZoomText rather than rounding it for better performance. r=roc
This commit is contained in:
parent
5c5459f2d8
commit
fc73382e05
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user