Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Round subpixel border widths to nearest integer instead of nearest-be…

…low integer.

Bump Goanna version for visual rendering change.
This resolves #1556.
  • Loading branch information...
wolfbeast committed Dec 25, 2017
1 parent 8273b5c commit 7d810df6d25093d0985c97525abd4914a787ae8b
Showing with 4 additions and 5 deletions.
  1. +1 −1 config/milestone.txt
  2. +3 −4 layout/style/nsStyleStruct.h
@@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------

3.4.1
3.4.2
@@ -800,11 +800,10 @@ class nsCSSShadowArray final {
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))
// 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.

6 comments on commit 7d810df

@hobbledehoy899

This comment has been minimized.

Copy link

replied Jan 8, 2018

Would it be possible to implement this fix in such a way so as to not have it impact the thickness of the text cursor? I've posted a demonstration of what I'm talking about on the forum.

@mattatobin

This comment has been minimized.

Copy link
Member

replied Jan 8, 2018

I doubt it.

@hobbledehoy899

This comment has been minimized.

Copy link

replied Jan 9, 2018

It needs to be undone.

@Rodocks

This comment has been minimized.

Copy link

replied Jan 9, 2018

please don't merge this

@wolfbeast

This comment has been minimized.

Copy link
Member Author

replied Jan 9, 2018

It's certainly possible to split the caret behavior off from the border behavior.
For borders, however, this is correct behavior. CSS borders should be rounded to the nearest pixel (like everything else is), not given special anaemic treatment.

@wolfbeast

This comment has been minimized.

Copy link
Member Author

replied Jan 9, 2018

Issue #1575

Please sign in to comment.
You can’t perform that action at this time.