summaryrefslogtreecommitdiffstats
path: root/layout/style/nsStyleStruct.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-04-18 20:15:33 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-04-18 20:15:33 +0200
commitd1b17ef97efd0e4f869c98dfada8d09f1cb1ad5a (patch)
tree3f0ee264ae10a8fe86ef3f56710f66b810fa89dc /layout/style/nsStyleStruct.h
parentfe15bb43decc414a6f57301da049b34f488556ab (diff)
downloadUXP-d1b17ef97efd0e4f869c98dfada8d09f1cb1ad5a.tar
UXP-d1b17ef97efd0e4f869c98dfada8d09f1cb1ad5a.tar.gz
UXP-d1b17ef97efd0e4f869c98dfada8d09f1cb1ad5a.tar.lz
UXP-d1b17ef97efd0e4f869c98dfada8d09f1cb1ad5a.tar.xz
UXP-d1b17ef97efd0e4f869c98dfada8d09f1cb1ad5a.zip
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.
Diffstat (limited to 'layout/style/nsStyleStruct.h')
-rw-r--r--layout/style/nsStyleStruct.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index ca5d03056..05a6be91e 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -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.