Use natural border width rounding.

Round subpixel border widths to nearest integer instead of nearest-below integer.
Split caret widths off from border widths and continue to use rounding to nearest-below integer for that.

Bump Goanna version for visual rendering change.
This commit is contained in:
wolfbeast 2018-04-18 20:15:33 +02:00 • committed by Roy Tam
commit 7754d12175
3 changed files with 10 additions and 7 deletions

View file

@ -1197,11 +1197,14 @@ private:
nsCSSShadowItem mArray[1]; // This MUST be the last item
};
// Border widths are rounded to the nearest-below integer number of pixels,
// but values between zero and one device pixels are always rounded up to
// one device pixel.
// Border widths are rounded to the nearest integer number of pixels, but values
// between zero and one device pixels are always rounded up to one device pixel.
#define NS_ROUND_BORDER_TO_PIXELS(l,tpp) \
((l) == 0) ? 0 : std::max((tpp), (l) / (tpp) * (tpp))
((l) == 0) ? 0 : std::max((tpp), ((l) + ((tpp) / 2)) / (tpp) * (tpp))
// Caret widths are rounded to the nearest-below integer number of pixels, but values
// between zero and one device pixels are always rounded up to one device pixel.
#define NS_ROUND_CARET_TO_PIXELS(l,tpp) \
((l) == 0) ? 0 : std::max((tpp), (l) / (tpp) * (tpp))
// Outline offset is rounded to the nearest integer number of pixels, but values
// between zero and one device pixels are always rounded up to one device pixel.
// Note that the offset can be negative.