1212
1313 /** @preserve
1414 * 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
1717 *
1818 * Copyright (c) 2010-2014 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
1919 * 2010 Aaron Spike, https://github.com/acspike
20262026 * pdfdoc.mymethod() // <- !!!!!!
20272027 */
20282028 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";
20302030
20312031 if (typeof define === 'function' && define.amd) {
20322032 define('jsPDF', function () {
@@ -5339,7 +5339,21 @@ Q\n";
53395339 this.pdf.rect(xRect.x, xRect.y, xRect.w, xRect.h, "s");
53405340 },
53415341
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+ */
53425352 clearRect: function clearRect(x, y, w, h) {
5353+ if (this.ctx.ignoreClearRect) {
5354+ return;
5355+ }
5356+
53435357 x = this._wrapX(x);
53445358 y = this._wrapY(y);
53455359
@@ -6552,6 +6566,16 @@ Q\n";
65526566 return this.ctx.globalAlpha;
65536567 }
65546568 });
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
65556579
65566580 c2d.internal = {};
65576581
@@ -6743,6 +6767,9 @@ Q\n";
67436767 this._clip_path = [];
67446768 // TODO miter limit //default 10
67456769
6770+ // Not HTML API
6771+ this.ignoreClearRect = false;
6772+
67466773 this.copy = function (ctx) {
67476774 this._isStrokeTransparent = ctx._isStrokeTransparent;
67486775 this._strokeOpacity = ctx._strokeOpacity;
@@ -6761,6 +6788,9 @@ Q\n";
67616788 this.globalCompositeOperation = ctx.globalCompositeOperation;
67626789 this.globalAlpha = ctx.globalAlpha;
67636790 this._clip_path = ctx._clip_path.slice(0); //TODO deep copy?
6791+
6792+ // Not HTML API
6793+ this.ignoreClearRect = ctx.ignoreClearRect;
67646794 };
67656795 }
67666796
0 commit comments