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

fix: revert the draw color and line width after drawing the table #930

Conversation

rarysson
Copy link
Contributor

@rarysson rarysson commented Oct 26, 2022

Fix #843

Before
before

After
after

@simonbengtsson
Copy link
Owner

Awesome! Would likely be better to add line width and drawColor to the userStyles object in documentHandler.ts#19. That way the original styles are applied for hooks etc as well and the implementation would be similar to text color etc.

Another note is that we might want to support previous versions of jsPDF autotable without those methods. To do this we can use a reasonable default similar to what is done if getTextColor is not available at documentHandler.ts#21.

@rarysson
Copy link
Contributor Author

rarysson commented Oct 27, 2022

Thank you for the feedback. I've changed to what you asked and it worked, as you can see below.

I saw that lineColor was responsible for setting the drawColor in documentHandler.ts#97, so because of this, I've used it for setting the default drawColor, if it's not the best approach, just let me know and I'll change.

result

@simonbengtsson
Copy link
Owner

💯🎉

@simonbengtsson simonbengtsson merged commit f3d4de7 into simonbengtsson:master Oct 27, 2022
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.

Autotable changes drawColor and lineWidth but doesn't change them back
2 participants