mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
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:
parent
2a7cc64699
commit
7754d12175
3 changed files with 10 additions and 7 deletions
|
|
@ -10,4 +10,4 @@
|
||||||
# hardcoded milestones in the tree from these two files.
|
# hardcoded milestones in the tree from these two files.
|
||||||
#--------------------------------------------------------
|
#--------------------------------------------------------
|
||||||
|
|
||||||
4.1.1
|
4.1.2
|
||||||
|
|
|
||||||
|
|
@ -200,8 +200,8 @@ nsCaret::ComputeMetrics(nsIFrame* aFrame, int32_t aOffset, nscoord aCaretHeight)
|
||||||
// between 0 and 1 goes up to 1 so we don't let the caret disappear.
|
// between 0 and 1 goes up to 1 so we don't let the caret disappear.
|
||||||
int32_t tpp = aFrame->PresContext()->AppUnitsPerDevPixel();
|
int32_t tpp = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||||
Metrics result;
|
Metrics result;
|
||||||
result.mCaretWidth = NS_ROUND_BORDER_TO_PIXELS(caretWidth, tpp);
|
result.mCaretWidth = NS_ROUND_CARET_TO_PIXELS(caretWidth, tpp);
|
||||||
result.mBidiIndicatorSize = NS_ROUND_BORDER_TO_PIXELS(bidiIndicatorSize, tpp);
|
result.mBidiIndicatorSize = NS_ROUND_CARET_TO_PIXELS(bidiIndicatorSize, tpp);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1197,10 +1197,13 @@ private:
|
||||||
nsCSSShadowItem mArray[1]; // This MUST be the last item
|
nsCSSShadowItem mArray[1]; // This MUST be the last item
|
||||||
};
|
};
|
||||||
|
|
||||||
// Border widths are rounded to the nearest-below integer number of pixels,
|
// Border widths are rounded to the nearest integer number of pixels, but values
|
||||||
// but values between zero and one device pixels are always rounded up to
|
// between zero and one device pixels are always rounded up to one device pixel.
|
||||||
// one device pixel.
|
|
||||||
#define NS_ROUND_BORDER_TO_PIXELS(l,tpp) \
|
#define NS_ROUND_BORDER_TO_PIXELS(l,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))
|
((l) == 0) ? 0 : std::max((tpp), (l) / (tpp) * (tpp))
|
||||||
// Outline offset is rounded to the nearest integer number of pixels, but values
|
// 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.
|
// between zero and one device pixels are always rounded up to one device pixel.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue