On Wed, 5 Jul 2023 11:56:05 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> How will counting the number of pixels of a particular color help in >> validating the fix? I was planning to take a portion of image which includes >> header and 1st row and then check the column of vertical line from header to >> data, if all are same color then its a straight line, else fail the test... >> But I was not able to compare the data, some inconsistencies were there with >> rgb values.... Will try to work on that again...... > > I wasn't clear enough, however, you understood it. There are three possible > colours in the header: background, highlight and shadow. There's also text > which we can ignore; if anti-aliasing is disabled, it will be solid colour > only; alternatively the headers may have no text at all or a space. > > So, the header should start with highlight colour, there should be 2 pixels > of it at 225%, right? Then the highlight is followed by the background until > you find the shadow colour. It should also be 2 pixels. The shadow should be > followed by the highlight colour of the next cell, there should be no > background colour between highlight and shadow. > > This algorithm works in the > [`ScaledEtchedBorderTest.java`](https://github.com/openjdk/jdk/blob/00ac46c06d8a7154a007cd67092bd80226a02fc3/test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java) > test, see the [`checkBorder` > method](https://github.com/openjdk/jdk/blob/00ac46c06d8a7154a007cd67092bd80226a02fc3/test/jdk/javax/swing/border/EtchedBorder/ScaledEtchedBorderTest.java#L151-L154). I understood your algorithm, hadn't thought this way. What I did is to get the grid line color from data cell, then just compare for the same color at same columns (for straight line/alignment w.r.t vertical grid line and vertical header border). Before my fix, there would be shift of header line to one pixel left, hence the test would fail. I guess this way I can ensure that the alignment will be there after the fix. I tested it in mach5, it is green. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14766#discussion_r1253166365