Snap the CENTER of a stroke so it renders crisply for the given width.
A stroke is crisp when both of its edges land on device-pixel boundaries. That
requires an odd device-pixel width to be centered on a half device pixel, and
an even width on a whole device pixel. Two layers that snap the same boundary
coordinate with the same width resolve to the same device pixels, so they line
up with each other (and stay aligned and crisp across device pixel ratios).
This is the device-aware replacement for the former (no-op) boundPixel.
Parameters
cssCenter: number
The desired stroke center, in CSS pixels.
cssWidth: number = 1
The stroke width, in CSS pixels (used only for odd/even parity).
Snap the CENTER of a stroke so it renders crisply for the given width.
A stroke is crisp when both of its edges land on device-pixel boundaries. That requires an odd device-pixel width to be centered on a half device pixel, and an even width on a whole device pixel. Two layers that snap the same boundary coordinate with the same width resolve to the same device pixels, so they line up with each other (and stay aligned and crisp across device pixel ratios).
This is the device-aware replacement for the former (no-op)
boundPixel.