Skip to content

Commit d58e0fa

Browse files
committed
Merge pull request #203 from bgribaudo/patch-3
Allow setting lines()'s style to be posponed
2 parents 00bcb6f + 052b99c commit d58e0fa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jspdf.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ var jsPDF = (function(global) {
10031003
* @param {Number} x Coordinate (in units declared at inception of PDF document) against left edge of the page
10041004
* @param {Number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
10051005
* @param {Number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction.
1006-
* @param {String} style One of 'S' (the default), 'F', 'FD' or 'DF'. 'S' draws just the curve. 'F' fills the region defined by the curves. 'DF' or 'FD' draws the curves and fills the region.
1006+
* @param {String} style One of 'S' (the default), 'F', 'FD', 'DF' or null. 'S' draws just the curve. 'F' fills the region defined by the curves. 'DF' or 'FD' draws the curves and fills the region. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.
10071007
* @param {Boolean} closed If true, the path is closed with a straight line from the end of the last curve to the starting point.
10081008
* @function
10091009
* @returns {jsPDF}
@@ -1025,7 +1025,6 @@ var jsPDF = (function(global) {
10251025
lines = tmp;
10261026
}
10271027

1028-
style = getStyle(style);
10291028
scale = scale || [1, 1];
10301029

10311030
// starting point
@@ -1070,7 +1069,9 @@ var jsPDF = (function(global) {
10701069
}
10711070

10721071
// stroking / filling / both the path
1073-
out(style);
1072+
if (style) {
1073+
out(getStyle(style));
1074+
}
10741075
return this;
10751076
};
10761077

0 commit comments

Comments
 (0)