Skip to content

Improved selection rect handling #27

Description

@ocrickard

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions