On Mon, 24 Nov 2025 20:23:28 GMT, Andy Goryachev <[email protected]> wrote:

> Fixing a bug in `SimpleViewOnlyStyledModel.lastParagraph()` which breaks 
> adding text segments after a `Region`-based paragraph.
> 
> Test cases:
> 
>     @Test
>     public void addTextAfterRegion() {
>         SimpleViewOnlyStyledModel m = new SimpleViewOnlyStyledModel();
>         m.addParagraph(() -> new Region());
>         m.addNodeSegment(() -> new Region());
>         assertEquals(2, m.size());
>     }
> 
>     @Test
>     public void addTextAfterRegionAfterText() {
>         SimpleViewOnlyStyledModel m = new SimpleViewOnlyStyledModel();
>         m.addNodeSegment(() -> new Region());
>         m.addParagraph(() -> new Region());
>         m.addSegment("text");
>         assertEquals(3, m.size());
>     }

This pull request has now been integrated.

Changeset: 03612e1b
Author:    Andy Goryachev <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/03612e1b4855c178febe63160070af66e82f9ee1
Stats:     83 lines in 2 files changed: 67 ins; 0 del; 16 mod

8372438: SimpleViewOnlyStyledModel: non-text paragraphs

Reviewed-by: zelmidaoui, lkostyra

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

PR: https://git.openjdk.org/jfx/pull/1983

Reply via email to