Skip to content

Commit

Permalink
0.1.56
Browse files Browse the repository at this point in the history
  • Loading branch information
liborm85 committed May 4, 2019
1 parent d630165 commit 2f3c8cb
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
35 changes: 22 additions & 13 deletions build/pdfmake.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pdfmake v0.1.55, @license MIT, @link http://pdfmake.org */
/*! pdfmake v0.1.56, @license MIT, @link http://pdfmake.org */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -18791,9 +18791,15 @@ function renderVector(vector, pdfKitDoc) {

//TODO: clipping

var gradient = null;

switch (vector.type) {
case 'ellipse':
pdfKitDoc.ellipse(vector.x, vector.y, vector.r1, vector.r2);

if (vector.linearGradient) {
gradient = pdfKitDoc.linearGradient(vector.x - vector.r1, vector.y, vector.x + vector.r1, vector.y);
}
break;
case 'rect':
if (vector.r) {
Expand All @@ -18803,14 +18809,7 @@ function renderVector(vector, pdfKitDoc) {
}

if (vector.linearGradient) {
var gradient = pdfKitDoc.linearGradient(vector.x, vector.y, vector.x + vector.w, vector.y);
var step = 1 / (vector.linearGradient.length - 1);

for (var i = 0; i < vector.linearGradient.length; i++) {
gradient.stop(i * step, vector.linearGradient[i]);
}

vector.color = gradient;
gradient = pdfKitDoc.linearGradient(vector.x, vector.y, vector.x + vector.w, vector.y);
}
break;
case 'line':
Expand Down Expand Up @@ -18841,6 +18840,16 @@ function renderVector(vector, pdfKitDoc) {
break;
}

if (vector.linearGradient && gradient) {
var step = 1 / (vector.linearGradient.length - 1);

for (var i = 0; i < vector.linearGradient.length; i++) {
gradient.stop(i * step, vector.linearGradient[i]);
}

vector.color = gradient;
}

if (vector.color && vector.lineColor) {
pdfKitDoc.fillColor(vector.color, vector.fillOpacity || 1);
pdfKitDoc.strokeColor(vector.lineColor, vector.strokeOpacity || 1);
Expand Down Expand Up @@ -59478,14 +59487,14 @@ DocPreprocessor.prototype.preprocessText = function (node) {

var tocItemId = node.tocItem[i];

if (!node.id) {
node.id = 'toc-' + tocItemId + '-' + this.tocs[tocItemId].toc._items.length;
}

if (!this.tocs[tocItemId]) {
this.tocs[tocItemId] = {toc: {_items: [], _pseudo: true}};
}

if (!node.id) {
node.id = 'toc-' + tocItemId + '-' + this.tocs[tocItemId].toc._items.length;
}

var tocItemRef = {
_nodeRef: this._getNodeForNodeRef(node),
_textNodeRef: node
Expand Down
2 changes: 1 addition & 1 deletion build/pdfmake.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/pdfmake.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdfmake.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pdfmake",
"version": "0.1.55",
"version": "0.1.56",
"description": "Client/server side PDF printing in pure JavaScript",
"main": "src/printer.js",
"browser": "build/pdfmake.js",
Expand Down

0 comments on commit 2f3c8cb

Please sign in to comment.