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

Draw point when clicking and releasing without moving cursor #136

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

fpohtmeh-github
Copy link
Contributor

Path had a visual artifact at the beginning

@DamirPorobic DamirPorobic self-requested a review July 27, 2020 17:37
@DamirPorobic
Copy link
Member

A specific reason why you're removing this part?

@fpohtmeh-github
Copy link
Contributor Author

fpohtmeh-github commented Jul 27, 2020

A specific reason why you're removing this part?

Every path has the same beginning (0; 0) -> (1; 1). It's quite obvious thing when I draw horizontal or vertical lines.
This hardcoded segment looks even worse when I add zooming in another branch.

It's better to move to startPosition then line to startPosition to get start point.
Opposite question: why do you need that (1; 1)? :)

@DamirPorobic
Copy link
Member

Opposite question: why do you need that (1; 1)? :)

Glad you asked xD
The only reason for that part being there is that when you click on the AnnotationArea and release without moving the mouse cursor, you get an invisible path. It's there, you can select it, resize, move, but it's not visible as the painter doesn't draw paths with 0 length. A clean solution would be to check for paths with 0 length and draw a dot instead in this special case.

@fpohtmeh-github
Copy link
Contributor Author

(0; 0) - (1; 1) is a dirty hack.
Drawing of point with diameter that's equal to line width is the correct solution. I can implement that

@DamirPorobic
Copy link
Member

Yeap, that would be the correct solution. Thanks.

@DamirPorobic DamirPorobic changed the title Fix path beginning Draw point when clicking and releasing without moving cursor Jul 30, 2020
DamirPorobic added a commit that referenced this pull request Jul 30, 2020
@DamirPorobic DamirPorobic merged commit de7239b into ksnip:master Jul 30, 2020
@DamirPorobic DamirPorobic added the enhancement New feature or request label Jul 30, 2020
@DamirPorobic
Copy link
Member

Merged, thanks for providing the PR.

DamirPorobic added a commit that referenced this pull request Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants