On Tue, 21 Jul 2026 19:46:24 GMT, Phil Race <[email protected]> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Move paintString block to paint
>
> src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java line 227:
> 
>> 225:                 g2d.fillRect(0, 0, width, height);
>> 226:                 paintProgressBar(g2d, i, width, height);
>> 227:                 if (progressBar.isStringPainted() && 
>> !progressBar.isIndeterminate()) {
> 
> I wasn't expecting to see this call twice now, and more of a concern it is 
> still not right.
> In this case the text is still painted blocky because you are still drawing 
> into the BI, the only thing that is fixed is that it is no longer mirrored.
> This call should only be made in one place and it should be immediately 
> before returning and look like
> 
>         if (progressBar.isStringPainted() && !progressBar.isIndeterminate()) {
>             paintString(g, i.left, i.top, width, height);
>         }
> 
> I think you need to enhance the test to draw the progress string - and also 
> test with an RTL component so we can prove this all works and renders in the 
> right place too ..

> you are still drawing into the BI,
> if (progressBar.isStringPainted() && !progressBar.isIndeterminate()) {
>         paintString(g, i.left, i.top, width, height);
>     }

I used paintString draw into BI graphics context as paintString was bailing out 
if it is not Graphics2D
and since I was anyway creating Graphics2D object from BI I used that

https://github.com/openjdk/jdk/blob/16fbf6289b03dd4d708ff31a6318f5df18bd3afe/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java#L217-L218

but now I used normal Graphics context to draw string and modified paintString 
to allow non Graphics2D context too

> enhance the test to draw the progress string - and also test with an RTL 
> component 

Progress string was anyway drawn..I have now enhanced the test to use both LTR 
and RTL

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31749#discussion_r3627932506

Reply via email to