Skip to content

Conversation

@Symeon94
Copy link
Collaborator

As per title. Tests were previously added and merged and this branch is used to clean it up.

Note that I did change a little behaviour here, the trim method is now capping the end value to not allow negative number.

public Paragraph<PS, SEG, S> trim(int end) {
    end = Math.max(0, end);
    // ...
}

}
return new Paragraph<>(paragraphStyle, segmentOps, segs, styles.subView(0, length));
public Paragraph<PS, SEG, S> trim(int end) {
end = Math.max(0, end);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a behaviour change (you can see the adaptation in the test for it), any trim with negative number should equal to trimming with 0 (it was already the case for some negative values, but not all).


// Restyle up to the end
// Bug
checkStyle(p3.restyle(11, 18, "out"), 18,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the bug was with out-of-bound indexes, but it is actually a bug when you go up to the length. I created #1310 to handle that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant