diff --git a/src/export.js b/src/export.js index 6462dae4..d0f4695c 100644 --- a/src/export.js +++ b/src/export.js @@ -22,6 +22,8 @@ paper = new (PaperScope.inject(Base.exports, { Base: Base, Numerical: Numerical, Key: Key, + DomEvent: DomEvent, + DomElement: DomElement, // Export jsdom document and window too, for Node.js document: document, window: window diff --git a/src/node/extend.js b/src/node/extend.js index 7928f67f..542aa65b 100644 --- a/src/node/extend.js +++ b/src/node/extend.js @@ -71,6 +71,11 @@ module.exports = function(paper) { Canvas: '#createCanvas' }); + // Override requestAnimationFrame() to avoid setInterval() timers. + paper.DomEvent.requestAnimationFrame = function(callback) { + process.nextTick(callback); + }; + // Node.js based image exporting code. paper.CanvasView.inject({ // DOCS: CanvasView#exportFrames(param);