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

context2d: paths sometimes not translating between pages #2774

Closed
ognyanstanev opened this issue Jun 16, 2020 · 3 comments · Fixed by #2793
Closed

context2d: paths sometimes not translating between pages #2774

ognyanstanev opened this issue Jun 16, 2020 · 3 comments · Fixed by #2793
Assignees
Labels

Comments

@ognyanstanev
Copy link

In context2d module at 3 places pages.sort() is being called. It sorts the pages as strings so 10 is before 9 for example. This causes problems when autoPaging is turned on.

  1. get context2d
  2. fill a rectangle for example, starting from page 10 going upwards to page 9.
  3. nothing is drawn
@HackbrettXXX
Copy link
Collaborator

Can you share a short code snippet that reproduces the issue?

@ognyanstanev
Copy link
Author

ognyanstanev commented Jun 26, 2020

var doc = new jsPDF({format:[100, 100]});
var ctx = doc.context2d;
ctx.autoPaging = true;
ctx.fillRect(0, 750, 20, 100); // rectangle starting from page 8 going to page 9 is drawn
ctx.fillRect(0, 850, 20, 100); // rectangle starting from page 9 going to page 10 is not drawn

Untitled

@HackbrettXXX
Copy link
Collaborator

Ah yes, you are right. I'll prepare a PR.

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

Successfully merging a pull request may close this issue.

2 participants