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

Improved selection rect handling #27

Open
ocrickard opened this issue Jun 6, 2018 · 0 comments
Open

Improved selection rect handling #27

ocrickard opened this issue Jun 6, 2018 · 0 comments

Comments

@ocrickard
Copy link
Contributor

Most text highlighting for large blocks break down into 3 parts, first line, body, and last line. This gives the selection a really nice outline, and also avoids the N^2 computation in the bezier path construction as more and more lines are selected.

Here's an example implementation that assumes the input rects were added to an array before the bezier path is computed:

https://gist.github.com/ocrickard/d07e30f9ba2c29fef7e491ab42c19d08

This can be done waaaaay more elegantly in Swift.

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

No branches or pull requests

1 participant