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

feat: draft freehand highlighter #77

Merged
merged 6 commits into from
Jun 20, 2024
Merged

feat: draft freehand highlighter #77

merged 6 commits into from
Jun 20, 2024

Conversation

DerpDays
Copy link
Contributor

@DerpDays DerpDays commented Apr 25, 2024

This is will add a freehand highlighter as the default (with shift to align it), and then have a selection highlight (like there currently is) accessible by pressing ctrl whilst on the highlighter, since this was suggested at some point (though since currently the highlighter tool is the selection it might make more sense to make the freehand one accessible through ctrl instead), currently this is just draft and needs quite a bit of cleanup.

EDIT: kept the block/selection highlighter as the default, with the freehand/line highlighter being the alternative highlighter, this is configurable via the CLI or config.

@00-kat
Copy link
Contributor

00-kat commented May 12, 2024

though since currently the highlighter tool is the selection it might make more sense to make the freehand one accessible through ctrl instead

I think (not a dev, just a random user) that it should probably be an option you can set in the config file.

@DerpDays
Copy link
Contributor Author

yeah that's probably best, i'll get to working on this in a few days so it can finally not be a draft

@gabm
Copy link
Owner

gabm commented May 13, 2024

I agree.. I didn't have a look at the PR, @DerpDays let me know if I can help

@DerpDays DerpDays marked this pull request as ready for review June 2, 2024 04:16
@DerpDays
Copy link
Contributor Author

DerpDays commented Jun 2, 2024

Sorry for the large delay & also the large commit (this should have been broken down into quite a few more commits).

This should mostly ready, here's an overview of the new things:

  • Adds a new highlighter, which is a freehand line/pen highlight, by default it is the secondary highlighter meaning it is accessible with CTRL, by pressing SHIFT while highlighting it aligns it from the previous point that was not aligned. To make it easier to make perfect turns, you can release SHIFT to add an extra point (and do it again to remove the point if you want) when you haven't moved the cursor.
  • Removed the border around the block highlighter since its not necessary and inconsistent with other tools apart from the blur tool.
  • Added a SHIFT option for the block highlight to make a square highlight.
  • Configuration/command line options to change the primary highlighter to the line highlighter.
  • Add a new event for tools: key_release which as implied is when a key is released (in contrast to the previous event of when pressed)

Let me know if there's anything that needs changing or can be done better.

@00-kat
Copy link
Contributor

00-kat commented Jun 2, 2024

If you start holding shift mid-way should it draw a straight line from the beginning or from the spot you started holding shift from (it does latter rn)?

@DerpDays
Copy link
Contributor Author

DerpDays commented Jun 2, 2024

The spot you started holding shift from, thought it'd give more options for how people want to draw it, since you can just hold shift when starting the highlight to achieve the other effect

@gabm
Copy link
Owner

gabm commented Jun 3, 2024

I just tested it, it looks great!

Copy link
Owner

@gabm gabm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adress the comments above, then we are good to go! Great contribution 🎉

README.md Outdated Show resolved Hide resolved
src/tools/highlight.rs Outdated Show resolved Hide resolved
@gabm gabm merged commit 3f29a5b into gabm:main Jun 20, 2024
3 checks passed
@gabm
Copy link
Owner

gabm commented Jun 20, 2024

Thank you for this great contribution 🥳

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

Successfully merging this pull request may close these issues.

3 participants