jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

.setFillColor() overwritten by calling .text()

Open jwld opened this issue 3 years ago • 0 comments

I have read and understood the contribution guidelines.

With the following code the rect fill is black. If I remove the .text call it is red as expected.

const doc = new jsPDF()

doc.setFillColor(255, 0, 0)
doc.text('hello', 10, 10)
doc.rect(90, 10, 10, 10, 'F')

doc.output('pdfobjectnewwindow')

I'm presuming this behaviour isn't intended? I can't see anything in the docs about it.

jwld avatar Aug 11 '22 14:08 jwld