pdfmake 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,6 +153,7 @@ class DocumentContext extends _events.EventEmitter {
153
153
  let maxBottomY = this.y;
154
154
  let maxBottomPage = this.page;
155
155
  let maxBottomAvailableHeight = this.availableHeight;
156
+ let overflowed = saved.overflowed;
156
157
 
157
158
  // Pop overflowed snapshots created by moveToNextColumn (snaking columns).
158
159
  // Merge their bottomMost values to find the true maximum.
@@ -170,16 +171,17 @@ class DocumentContext extends _events.EventEmitter {
170
171
  if (!saved) {
171
172
  return {};
172
173
  }
173
-
174
- // Apply the max bottom from all overflowed columns to this base snapshot
175
- if (maxBottomPage > saved.bottomMost.page || maxBottomPage === saved.bottomMost.page && maxBottomY > saved.bottomMost.y) {
176
- saved.bottomMost = {
177
- x: saved.x,
178
- y: maxBottomY,
179
- page: maxBottomPage,
180
- availableHeight: maxBottomAvailableHeight,
181
- availableWidth: saved.availableWidth
182
- };
174
+ if (overflowed) {
175
+ // Apply the max bottom from all overflowed columns to this base snapshot
176
+ if (maxBottomPage > saved.bottomMost.page || maxBottomPage === saved.bottomMost.page && maxBottomY > saved.bottomMost.y) {
177
+ saved.bottomMost = {
178
+ x: saved.x,
179
+ y: maxBottomY,
180
+ page: maxBottomPage,
181
+ availableHeight: maxBottomAvailableHeight,
182
+ availableWidth: saved.availableWidth
183
+ };
184
+ }
183
185
  }
184
186
  this.calculateBottomMost(saved, endingCell);
185
187
  this.x = saved.x;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdfmake",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Client/server side PDF printing in pure JavaScript",
5
5
  "main": "js/index.js",
6
6
  "esnext": "src/index.js",
@@ -165,6 +165,8 @@ class DocumentContext extends EventEmitter {
165
165
  let maxBottomPage = this.page;
166
166
  let maxBottomAvailableHeight = this.availableHeight;
167
167
 
168
+ let overflowed = saved.overflowed;
169
+
168
170
  // Pop overflowed snapshots created by moveToNextColumn (snaking columns).
169
171
  // Merge their bottomMost values to find the true maximum.
170
172
  while (saved && saved.overflowed) {
@@ -186,19 +188,21 @@ class DocumentContext extends EventEmitter {
186
188
  return {};
187
189
  }
188
190
 
189
- // Apply the max bottom from all overflowed columns to this base snapshot
190
- if (
191
- maxBottomPage > saved.bottomMost.page ||
192
- (maxBottomPage === saved.bottomMost.page &&
193
- maxBottomY > saved.bottomMost.y)
194
- ) {
195
- saved.bottomMost = {
196
- x: saved.x,
197
- y: maxBottomY,
198
- page: maxBottomPage,
199
- availableHeight: maxBottomAvailableHeight,
200
- availableWidth: saved.availableWidth
201
- };
191
+ if (overflowed) {
192
+ // Apply the max bottom from all overflowed columns to this base snapshot
193
+ if (
194
+ maxBottomPage > saved.bottomMost.page ||
195
+ (maxBottomPage === saved.bottomMost.page &&
196
+ maxBottomY > saved.bottomMost.y)
197
+ ) {
198
+ saved.bottomMost = {
199
+ x: saved.x,
200
+ y: maxBottomY,
201
+ page: maxBottomPage,
202
+ availableHeight: maxBottomAvailableHeight,
203
+ availableWidth: saved.availableWidth
204
+ };
205
+ }
202
206
  }
203
207
 
204
208
  this.calculateBottomMost(saved, endingCell);