Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/plugin/pagebreaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ Worker.prototype.toContainer = function toContainer() {

// Before: Create a padding div to push the element to the next page.
if (rules.before) {
var height = clientRect.top >= 0
? pxPageHeight - (clientRect.top % pxPageHeight)
: Math.abs(clientRect.top);
var pad = createElement('div', {style: {
display: 'block',
height: pxPageHeight - (clientRect.top % pxPageHeight) + 'px'
height: height + 'px'
}});
el.parentNode.insertBefore(pad, el);
}
Expand Down