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

Add smooth line drawing in sprite editor #1967

Merged
merged 2 commits into from Jun 27, 2022
Merged

Add smooth line drawing in sprite editor #1967

merged 2 commits into from Jun 27, 2022

Conversation

solarized-fox
Copy link

currently when drawing in tic80's sprite editor, only the point at the current mouse position is "stamped", which leads to undesirable gaps in the user's stroke:
before

this pull request changes the behavior to draw a line between the previous mouse position (now cached as a member of the Sprite struct) and the current one, resulting in an unbroken stroke:
after

hopefully this change is useful, if there is anything that I should change please feel free to let me know, too.

tic_tilesheet_setpix(&sprite->sheet, x+i, y+j, color);
}

static void paintLine(Sprite* sprite, u8 color, s32 x1, s32 y1, s32 x2, s32 y2)
Copy link
Owner

Choose a reason for hiding this comment

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

You can call tic_api_line() instead the own line dwawing implementation.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh, sorry, I see, you draw line depending on brush size.

@nesbox nesbox added this to In progress in dev version 1.2 via automation Jun 27, 2022
@nesbox nesbox assigned nesbox and solarized-fox and unassigned nesbox Jun 27, 2022
@nesbox nesbox merged commit d848942 into nesbox:main Jun 27, 2022
dev version 1.2 automation moved this from In progress to Done Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants