You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow direct use of these PDF path-painting operators:
723
+
- f fill using nonzero winding number rule
724
+
- f* fill using even-odd rule
725
+
- B fill then stroke with fill using non-zero winding number rule
726
+
- B* fill then stroke with fill using even-odd rule
727
+
*/
728
+
op=style;
720
729
}
721
730
returnop;
722
731
},
@@ -1003,7 +1012,7 @@ var jsPDF = (function(global) {
1003
1012
* @param {Number} x Coordinate (in units declared at inception of PDF document) against left edge of the page
1004
1013
* @param {Number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
1005
1014
* @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', '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.
1015
+
* @param {String} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. 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.
1007
1016
* @param {Boolean} closed If true, the path is closed with a straight line from the end of the last curve to the starting point.
1008
1017
* @function
1009
1018
* @returns {jsPDF}
@@ -1069,7 +1078,7 @@ var jsPDF = (function(global) {
1069
1078
}
1070
1079
1071
1080
// stroking / filling / both the path
1072
-
if(style){
1081
+
if(style!==null){
1073
1082
out(getStyle(style));
1074
1083
}
1075
1084
returnthis;
@@ -1082,7 +1091,7 @@ var jsPDF = (function(global) {
1082
1091
* @param {Number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
1083
1092
* @param {Number} w Width (in units declared at inception of PDF document)
1084
1093
* @param {Number} h Height (in units declared at inception of PDF document)
1085
-
* @param {String} style (Defaults to active fill/stroke style) A string signalling if stroke, fillor both are to be applied.
1094
+
* @param {String} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. 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.
1086
1095
* @function
1087
1096
* @returns {jsPDF}
1088
1097
* @methodOf jsPDF#
@@ -1095,9 +1104,13 @@ var jsPDF = (function(global) {
1095
1104
f2((pageHeight-y)*k),
1096
1105
f2(w*k),
1097
1106
f2(-h*k),
1098
-
're',
1099
-
op
1107
+
're'
1100
1108
].join(' '));
1109
+
1110
+
if(style!==null){
1111
+
out(getStyle(style));
1112
+
}
1113
+
1101
1114
returnthis;
1102
1115
};
1103
1116
@@ -1110,7 +1123,7 @@ var jsPDF = (function(global) {
1110
1123
* @param {Number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page
1111
1124
* @param {Number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page
1112
1125
* @param {Number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page
1113
-
* @param {String} style (Defaults to active fill/stroke style) A string signalling if stroke, fillor both are to be applied.
1126
+
* @param {String} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. 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.
1114
1127
* @function
1115
1128
* @returns {jsPDF}
1116
1129
* @methodOf jsPDF#
@@ -1140,7 +1153,7 @@ var jsPDF = (function(global) {
1140
1153
* @param {Number} h Height (in units declared at inception of PDF document)
1141
1154
* @param {Number} rx Radius along x axis (in units declared at inception of PDF document)
1142
1155
* @param {Number} rx Radius along y axis (in units declared at inception of PDF document)
1143
-
* @param {String} style (Defaults to active fill/stroke style) A string signalling if stroke, fillor both are to be applied.
1156
+
* @param {String} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. 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.
1144
1157
* @function
1145
1158
* @returns {jsPDF}
1146
1159
* @methodOf jsPDF#
@@ -1173,15 +1186,14 @@ var jsPDF = (function(global) {
1173
1186
* @param {Number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
1174
1187
* @param {Number} rx Radius along x axis (in units declared at inception of PDF document)
1175
1188
* @param {Number} rx Radius along y axis (in units declared at inception of PDF document)
1176
-
* @param {String} style (Defaults to active fill/stroke style) A string signalling if stroke, fillor both are to be applied.
1189
+
* @param {String} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. 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.
1177
1190
* @function
1178
1191
* @returns {jsPDF}
1179
1192
* @methodOf jsPDF#
1180
1193
* @name ellipse
1181
1194
*/
1182
1195
API.ellipse=function(x,y,rx,ry,style){
1183
-
varop=getStyle(style),
1184
-
lx=4/3*(Math.SQRT2-1)*rx,
1196
+
varlx=4/3*(Math.SQRT2-1)*rx,
1185
1197
ly=4/3*(Math.SQRT2-1)*ry;
1186
1198
1187
1199
out([
@@ -1221,9 +1233,13 @@ var jsPDF = (function(global) {
1221
1233
f2((pageHeight-(y+ly))*k),
1222
1234
f2((x+rx)*k),
1223
1235
f2((pageHeight-y)*k),
1224
-
'c',
1225
-
op
1236
+
'c'
1226
1237
].join(' '));
1238
+
1239
+
if(style!==null){
1240
+
out(getStyle(style));
1241
+
}
1242
+
1227
1243
returnthis;
1228
1244
};
1229
1245
@@ -1233,7 +1249,7 @@ var jsPDF = (function(global) {
1233
1249
* @param {Number} x Coordinate (in units declared at inception of PDF document) against left edge of the page
1234
1250
* @param {Number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page
1235
1251
* @param {Number} r Radius (in units declared at inception of PDF document)
1236
-
* @param {String} style (Defaults to active fill/stroke style) A string signalling if stroke, fillor both are to be applied.
1252
+
* @param {String} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. 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.
0 commit comments