On Fri, 12 Sep 2025 02:57:27 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Renjith Kannath Pariyangad has updated the pull request incrementally with 
>> one additional commit since the last revision:
>> 
>>   Updated summary
>
> src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java 
> line 558:
> 
>> 556:     static void applyInsets(Rectangle rect, Insets insets, boolean 
>> leftToRight) {
>> 557:         if (insets != null) {
>> 558:             Insets newInsets = new Insets(insets.top, (leftToRight ? 
>> insets.left : insets.right),
> 
> Maybe we can eliminate the creation of a new object on each paint event? 
> Since neither method is part of the public API, how about changing the 
> signature of SwingUtilities3.applyInsets and removing the corresponding 
> method in SynthGraphicsUtils?"

Agreed. `SwingUtilities3` can easily have two methods: `applyInsets(Rectangle 
rect, Insets insets)` as well as `applyInsets(Rectangle rect, Insets insets, 
boolean leftToRight)` where the former calls the latter with `leftToRight = 
true`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27157#discussion_r2345136670

Reply via email to