Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Z zathura
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 168
    • Issues 168
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pwmtpwmt
  • zathura
  • Merge requests
  • !59

Proper text selection upon mouse drag (Closes #26).

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Rahul Aggarwal requested to merge rahulaggarwal965/zathura:feature/selection into develop Nov 05, 2022
  • Overview 10
  • Commits 4
  • Pipelines 0
  • Changes 5

This PR replaces the current text selection rectangle functionality with "proper" selection between two points. It requires zathura-pdf-mupdf!8 (merged) to be merged. It does a couple of things:

  1. When the mouse is pressed and dragged, it will track the base point and the end point to form a selection rectangle.
  2. It will use a new plugin exposed in zathura-pdf-mupdf!8 (merged) to collect all the rectangles that represent a "proper selection" between said points.
  3. It will calculated the redraw area (it will have the page x bounds and it iterates over the rectangles to calculate y-bounds).
  4. It then clears the previous drawn selection rectangles and draws the new ones.

I have created a new struct on the zathura_page_widget_private_s called selection to keep track of this data. There are possibly a couple things that could be improved such as highlighting on latex math symbols, but this is definitely a great start.

Here is a picture of the result:

Click to expand zathura_text_highlight

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/selection