12
12
13
13
/** @preserve
14
14
* jsPDF - PDF Document creation from JavaScript
15
- * Version 1.3.0 Built on 2016-09-29T11:21:56.977Z
16
- * CommitID 899bfb5d23
15
+ * Version 1.3.0 Built on 2016-09-30T17:52:06.447Z
16
+ * CommitID c1dcb877a3
17
17
*
18
18
* Copyright (c) 2010-2014 James Hall <
[email protected] >, https://github.com/MrRio/jsPDF
19
19
* 2010 Aaron Spike, https://github.com/acspike
2026
2026
* pdfdoc.mymethod() // <- !!!!!!
2027
2027
*/
2028
2028
jsPDF.API = { events: [] };
2029
- jsPDF.version = "1.3.0 2016-09-29T11:21:56.977Z :jameshall";
2029
+ jsPDF.version = "1.3.0 2016-09-30T17:52:06.447Z :jameshall";
2030
2030
2031
2031
if (typeof define === 'function' && define.amd) {
2032
2032
define('jsPDF', function () {
@@ -5339,7 +5339,21 @@ Q\n";
5339
5339
this.pdf.rect(xRect.x, xRect.y, xRect.w, xRect.h, "s");
5340
5340
},
5341
5341
5342
+ /**
5343
+ * We cannot clear PDF commands that were already written to PDF, so we use white instead. <br />
5344
+ * As a special case, read a special flag (_ignoreClearRect) and do nothing if it is set.
5345
+ * This allows an calls to clearRect() to keep the canvas transparent.
5346
+ * This flag is stored in the save/restore context can managed in the same way as other drawing states.
5347
+ * @param x
5348
+ * @param y
5349
+ * @param w
5350
+ * @param h
5351
+ */
5342
5352
clearRect: function clearRect(x, y, w, h) {
5353
+ if (this.ctx.ignoreClearRect) {
5354
+ return;
5355
+ }
5356
+
5343
5357
x = this._wrapX(x);
5344
5358
y = this._wrapY(y);
5345
5359
@@ -6552,6 +6566,16 @@ Q\n";
6552
6566
return this.ctx.globalAlpha;
6553
6567
}
6554
6568
});
6569
+ // Not HTML API
6570
+ Object.defineProperty(c2d, 'ignoreClearRect', {
6571
+ set: function set(value) {
6572
+ this.ctx.ignoreClearRect = value;
6573
+ },
6574
+ get: function get() {
6575
+ return this.ctx.ignoreClearRect;
6576
+ }
6577
+ });
6578
+ // End Not HTML API
6555
6579
6556
6580
c2d.internal = {};
6557
6581
@@ -6743,6 +6767,9 @@ Q\n";
6743
6767
this._clip_path = [];
6744
6768
// TODO miter limit //default 10
6745
6769
6770
+ // Not HTML API
6771
+ this.ignoreClearRect = false;
6772
+
6746
6773
this.copy = function (ctx) {
6747
6774
this._isStrokeTransparent = ctx._isStrokeTransparent;
6748
6775
this._strokeOpacity = ctx._strokeOpacity;
@@ -6761,6 +6788,9 @@ Q\n";
6761
6788
this.globalCompositeOperation = ctx.globalCompositeOperation;
6762
6789
this.globalAlpha = ctx.globalAlpha;
6763
6790
this._clip_path = ctx._clip_path.slice(0); //TODO deep copy?
6791
+
6792
+ // Not HTML API
6793
+ this.ignoreClearRect = ctx.ignoreClearRect;
6764
6794
};
6765
6795
}
6766
6796
0 commit comments