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

fillColor turn's black when specifing an object to lineWidth #897

Closed
ferflores507 opened this issue Jul 4, 2022 · 5 comments · Fixed by #961
Closed

fillColor turn's black when specifing an object to lineWidth #897

ferflores507 opened this issue Jul 4, 2022 · 5 comments · Fixed by #961

Comments

@ferflores507
Copy link

This happens when you assign the object with some or all properties (top, right, bottom, left).

The workaround is to assign fillColor a value that is not false or null (another issue), in my case I had to assign white.

@JavorovNetIt
Copy link

I have the same issue!

@MikeDabrowski
Copy link
Contributor

Me too!

@simonbengtsson

drawBorderForSide(
doc,
cell,
cursor,
side,
fillStyle || 'S',
lineWidth[side]
)

Here is the place where the fillColor is replaced by 'S' which is the default for line stroke/fill. Imo, lines use jsPDF.setDrawColor, don't they?

I can create PR with the change.

@simonbengtsson
Copy link
Owner

Would be great! If all the examples works and the tests pass I'll merge right away 👌

@MikeDabrowski
Copy link
Contributor

MikeDabrowski commented Apr 17, 2023

So the changes would be:
Remove fallback here:

fillStyle || 'S',

And replace 'F' with cellStyles.fillColor (casted to null) here:
doc.rect(cell.x, cursor.y, cell.width, cell.height, 'F')

I actually doubt this 395 line is needed. I'm testing using my project's table where I use 'plain' theme, no borders here.
I'll get to work on the PR

@MikeDabrowski
Copy link
Contributor

@simonbengtsson PR ready, I'd appreciate if you take a look

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

Successfully merging a pull request may close this issue.

4 participants