Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache previous width and position when calculate currentWidth #129

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

brucewinger
Copy link

The current doBreakText will recalculate the width of the whole phase passed in. The commit caches the calculated previous width and previous position, so it only needs to calculate increased string. It decreases algorithm complexity from O(n^2) to O(n).

@pbrant
Copy link
Member

pbrant commented Nov 7, 2017

Thanks!

@pbrant pbrant closed this Nov 7, 2017
@pbrant pbrant reopened this Nov 7, 2017
@pbrant pbrant merged commit 5d12eeb into flyingsaucerproject:master Nov 7, 2017
@pbrant
Copy link
Member

pbrant commented Nov 7, 2017

Released as 9.1.8

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.

None yet

2 participants