On Wed, 31 Jan 2024 21:09:53 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> Karthik P K has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Fix issue with multiline text
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java
>  line 513:
> 
>> 511:                             if ((x > run.getWidth() && (!isMultiRunText 
>> || run.getStart() == curRunStart)) || textWidthPrevLine > 0) {
>> 512:                                 getBounds(run.getTextSpan(), 
>> textBounds);
>> 513:                                 x -= (runs[0].getLocation().x - 
>> textBounds.getMinX());
> 
> suggestion: we are still in the for loop, so perhaps it makes sense to 
> extract 
> `(runs[0].getLocation().x - textBounds.getMinX());`
> to a variable outside of the loop

The idea is that outside the loop we don't know if we need to subtract the 
textBound min x value and the starting location of the first run or not. That 
is why this is present inside the loop. Once this is done we are breaking out 
of the loop so this will not get called multiple times.
Let me know if you have any suggestions.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1323#discussion_r1473962144

Reply via email to