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

Partial drawing offset caused by nonzero brush density or min draw distance #59

Open
NinthDesertDude opened this issue Aug 19, 2022 · 0 comments
Labels

Comments

@NinthDesertDude
Copy link
Owner

This mainly affects pixel artists.

Basically, brush density and minimum draw distance check that some length requirement has been met to draw, and that's based on the previous mouse position. So if the user clicks exactly at the top-left corner, for a brush size of 1 (which sets density to 1), they must move the mouse a pixel's distance away in any direction to draw. That looks accurate if they move to the right, since the next pixel to the right is about a pixel away. But if they move to the left, they will almost cross through the entire pixel before it draws. This quirk really only occurs within the space of a pixel, so brush sizes of, say, 10 or greater won't see or care about this issue. Pixel artists, though, frequently draw at single pixel sizes.

Possible solution: round the mouse position to the center of a pixel when clicking, something like (int)x + 0.5f, then for any brush density or min draw distance threshold, subtract 0.5f from it. That means at size 1, it should allow stamping the brush as soon as it crosses into any adjacent pixel.

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

No branches or pull requests

1 participant