Integrated: 8316159: Update BoxLayout sample image for crisper edges

Alexey Ivanov aivanov at openjdk.org
Thu Sep 28 11:34:35 UTC 2023


On Wed, 13 Sep 2023 09:17:16 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> **Problem**
> 
> On a standard display with the scale of 100%, the BoxLayout sample has blurred edges.
> 
> It is the result of how SVG is rendered: the strokes fall between the pixel grid, therefore a 1-pixel wide stroke is blurred between the previous and the following pixels with 50% of colour on each pixel. It doesn't look as good.
> 
> **Fix**
> 
> Move all rectangles half a pixel to make edges crisp. The edges of the rectangles look crisp in 100% and 200%.
> 
> For more information see answers to the following questions on Stack Overflow:
> 
> - [Why is my SVG line blurry or 2px in height when I specified 1px?](https://stackoverflow.com/a/34229584/572834)
> - [Avoiding lines between adjacent SVG rectangles](https://stackoverflow.com/a/23376793/572834)

This pull request has now been integrated.

Changeset: 3481ecb2
Author:    Alexey Ivanov <aivanov at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3481ecb25585d427f2c272e475c7f4ebbf60b799
Stats:     5 lines in 1 file changed: 0 ins; 0 del; 5 mod

8316159: Update BoxLayout sample image for crisper edges

Move all rectangles half a pixel to make edges crisp

Reviewed-by: prr

-------------

PR: https://git.openjdk.org/jdk/pull/15703


More information about the client-libs-dev mailing list