Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions HOTFIX_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#Hotfixes

We sometimes bake-in solutions (A.K.A. hotfixes) to solve issues for specific use cases.

When we deem a hotfix will not break existing code,
will make it default behaviour and mark the hotfix as _accepted_,
At that point the define can be removed.

To enable a hotfix, define the following member of your created PDF,
where the pdf.hotfix field is the name of the hotfix.

var pdf new jsPDF(...);
pdf.hotfix.fill_close = true;

#Active Hotfixes

##fill_close
###Applies To
context2d plugin

### Affects
Filling paths

### Description
In certain cases, closing a fill would result in a path resolving to an incorrect point.
The was most likely fixed when we refactored matrix logic. Enabling this hotfix will ignore a most-likely unneeded workaround.

#Accepted Hotfixes
There a currently no accepted hotfixes.
13 changes: 9 additions & 4 deletions plugins/context2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,15 @@
}
}

// extra move bug causing close to resolve to wrong point
var x = moves[i].start.x;
var y = moves[i].start.y;
this.internal.line2(c2d, x, y);
if (this.pdf.hotfix && this.pdf.hotfix.fill_close) {
// do nothing
}
else {
// extra move bug causing close to resolve to wrong point
var x = moves[i].start.x;
var y = moves[i].start.y;
this.internal.line2(c2d, x, y);
}

this.pdf.internal.out('h');
this.pdf.internal.out('f');
Expand Down