Spotlight icon indicating copy to clipboard operation
Spotlight copied to clipboard

Feature: finish spotlight on touch outside of current target

Open valeryvpetrov-dev opened this issue 2 years ago • 1 comments

Problem

I've seen issue https://github.com/TakuSemba/Spotlight/issues/123 (from @aryandii) and decided to help you make Spotlight more functional ✨

Solution

So I added a new flag to make it possible to finish spotlight on touch outside of current target. Let's see how it looks like:

There is a listener to catch on touch outside of current target event. Finishing on touch outside is the only one usage of listener. If you want to add new Shape just create a child class and implement contains function. It can be quite complex if your shape is not primitive. So it can be not perfectly precise (and there is nothing horrible, IMHO). Round rectangle is an example of complex shape:

@TakuSemba , thanks a lot for your work. I hope this feature will improve your project and engage new developers 🤝

valeryvpetrov-dev avatar Mar 14 '22 19:03 valeryvpetrov-dev

49c939b increases accuracy. Now touch zone is slightly bigger than target:

valeryvpetrov-dev avatar Mar 15 '22 12:03 valeryvpetrov-dev