Comparing version 0.1.55 to 0.1.56
{ | ||
"name": "pdfmake", | ||
"version": "0.1.55", | ||
"version": "0.1.56", | ||
"description": "Client/server side PDF printing in pure JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "src/printer.js", |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -128,2 +128,6 @@ 'use strict'; | ||
if (!this.tocs[tocItemId]) { | ||
this.tocs[tocItemId] = {toc: {_items: [], _pseudo: true}}; | ||
} | ||
if (!node.id) { | ||
@@ -133,6 +137,2 @@ node.id = 'toc-' + tocItemId + '-' + this.tocs[tocItemId].toc._items.length; | ||
if (!this.tocs[tocItemId]) { | ||
this.tocs[tocItemId] = {toc: {_items: [], _pseudo: true}}; | ||
} | ||
var tocItemRef = { | ||
@@ -139,0 +139,0 @@ _nodeRef: this._getNodeForNodeRef(node), |
@@ -505,5 +505,11 @@ /*eslint no-unused-vars: ["error", {"args": "none"}]*/ | ||
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; | ||
@@ -518,10 +524,3 @@ case 'rect': | ||
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); | ||
} | ||
@@ -557,2 +556,12 @@ 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) { | ||
@@ -559,0 +568,0 @@ pdfKitDoc.fillColor(vector.color, vector.fillOpacity || 1); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
10198251
67225