Skip to content

Commit f0eb9a9

Browse files
committed
fix backport
1 parent 7e63828 commit f0eb9a9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/layoutBuilder.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,9 @@ LayoutBuilder.prototype.processRow = function ({ marginX = [0, 0], dontBreakRows
619619
// Reference to the last cell of the rowspan
620620
endingSpanCell = startingSpanCell._endingCell;
621621
// Store if we are in an unbreakable block when we save the context and the originalX
622-
if (this.writer.transactionLevel > 0) {
622+
if (self.writer.transactionLevel > 0) {
623623
endingSpanCell._isUnbreakableContext = true;
624-
endingSpanCell._originalXOffset = this.writer.originalX;
624+
endingSpanCell._originalXOffset = self.writer.originalX;
625625
}
626626
}
627627

@@ -635,13 +635,13 @@ LayoutBuilder.prototype.processRow = function ({ marginX = [0, 0], dontBreakRows
635635
var discountY = 0;
636636
if (dontBreakRows) {
637637
// Calculate how many points we have to discount to Y when dontBreakRows and rowSpan are combined
638-
const ctxBeforeRowSpanLastRow = this.writer.contextStack[this.writer.contextStack.length - 1];
638+
const ctxBeforeRowSpanLastRow = self.writer.contextStack[self.writer.contextStack.length - 1];
639639
discountY = ctxBeforeRowSpanLastRow.y - column._startingRowSpanY;
640640
}
641641
var originalXOffset = 0;
642642
// If context was saved from an unbreakable block and we are not in an unbreakable block anymore
643643
// We have to sum the originalX (X before starting unbreakable block) to X
644-
if (column._isUnbreakableContext && !this.writer.transactionLevel) {
644+
if (column._isUnbreakableContext && !self.writer.transactionLevel) {
645645
originalXOffset = column._originalXOffset;
646646
}
647647
// row-span ending
@@ -665,9 +665,9 @@ LayoutBuilder.prototype.processRow = function ({ marginX = [0, 0], dontBreakRows
665665
// Context will be stored here (ending cell)
666666
endingSpanCell = startingSpanCell._endingCell;
667667
// Store if we are in an unbreakable block when we save the context and the originalX
668-
if (this.writer.transactionLevel > 0) {
668+
if (self.writer.transactionLevel > 0) {
669669
endingSpanCell._isUnbreakableContext = true;
670-
endingSpanCell._originalXOffset = this.writer.originalX;
670+
endingSpanCell._originalXOffset = self.writer.originalX;
671671
}
672672
}
673673
}
@@ -678,7 +678,7 @@ LayoutBuilder.prototype.processRow = function ({ marginX = [0, 0], dontBreakRows
678678

679679
// If content did not break page, check if we should break by height
680680
if (!isUnbreakableRow && pageBreaks.length === 0 && willBreakByHeight) {
681-
self.writer.context().moveDown(this.writer.context().availableHeight);
681+
self.writer.context().moveDown(self.writer.context().availableHeight);
682682
self.writer.moveToNextPage();
683683
}
684684

0 commit comments

Comments
 (0)