Skip to content

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

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

Merge request reports