* Allow "tapping" when using the Select Rectangle and Select Region tools (in a similar way to tapping when drawing)
* Changed the implemetation of "tapping" selection to allow use with a stylus (that generates many more events than a mouse)
Co-authored-by: Luca Citi <lciti@ieee.org>
**Root Cause:**
The functions `createHighlighterOrPenCursor` and `getEraserCursor` were
returning early if the cursor type had not changed. This prevented the
updated of the cursor size, based on the new setting.
* Add option to ignore the first events of the stylus when touching the screen to avoid artifacts at the beginnings of strokes. The number of ignored events can be set in the preferences.
Explanation: There are setups with this issue: When the stylus is pressed on the screen, the accuracy and update rate of its recognized position increases. Because of the lower precision before, when hitting the screen the cursor might jump from its previous position to the more precise point (this is especially far if the pen tip was in rapid movement right before touching), while beeing recognized as writing. This can result in artifacts that e.g. make handwritten text very hard to read. To work around this, the first events since the triggering event can be ignored.
* Add requested variable
* Fix handling of deviceClassPressed and implement requested change
This Commit changes the Pen/Highlighter Cursor to have the form of a
circle (via `cairo_arc`) and also uses the set size to give a correct
impression on how big the line one is about to draw is.
When moving to the last page of the following PDF document, https://dx.doi.org/10.1109/TSE.1985.232210,
xournal++ hangs (segfaults). You can try to move to the last page either by scrolling
or by setting the page number in the spinpage box, the result will be the same.
After some debugging, I narrowed it down to the latest statement of Layout::updateVisibility():
this->view->getControl()->firePageSelected(mostPageNr). For some reason, this was triggering an
infinite storm of events.
Currently, the updateVisility() is always creating a page selected event, even if there is no
change in page visibility. My solution was to fire the event only if a change occurred
in the visibility.
I used std::optional for the variable mostPageNr. If it was not changed by updateVisibility()'s
algorithm, we do not fire the event that depends upon on mostPageNr's value.