On Wed, 17 Apr 2024 09:55:43 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

> > As far as I understand the test creates two enabled-JComboBox, then 
> > disables both, and then compares the disabled and enabled images. Why there 
> > are some differences in sizes and colors?
> 
> Difference in size is specific to LAFs like in case on Metal and Motif the 
> sizes are same but in Nimbus and GTK it differs in size. For Nimbus when 
> DefaultListCellRenderer is used the width is 2px more than when 
> SynthComboBoxRenderer is used. This is due to the difference in Inset values. 
> In case of DefaultListCellRenderer the Insets value (left and right) are 1 px 
> more than the insets value for SynthComboBoxRenderer.
> 
> Similarly in GTK LAF also the insets values are different in 
> DefaultListCellRenderer and SynthComboBoxRenderer.
> 
> Color difference is only in the background color for Windows LAF which is 
> slightly different.

This sounds about right. I looked into this difference briefly in my original 
fix, and checked the insets, bounds, and borders. Now that you mention it, I 
remember it was the insets that differed between the two renderers. Didn't seem 
related to the issue/fix and may be intended, so I left it as is and modified 
my test to use a midline scan to compare the pixel colors between the two 
comboboxes.

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

PR Comment: https://git.openjdk.org/jdk/pull/18644#issuecomment-2064335397

Reply via email to