Comparing version 1.2.1 to 1.2.2
@@ -50,3 +50,4 @@ const Random = require('./random.js'); | ||
Carbonator.prototype.step = function() { | ||
requestAnimationFrame(function () { | ||
cancelAnimationFrame(this.animationFrame); | ||
this.animationFrame = requestAnimationFrame(function () { | ||
let oldWidth = this.width; | ||
@@ -181,3 +182,3 @@ let oldHeight = this.height; | ||
try { | ||
const jQuery = require('jquery'); | ||
const jQuery = global.jQuery || require('jquery'); | ||
@@ -184,0 +185,0 @@ jQuery.fn[PLUGIN_NAME] = function ( options ) { |
{ | ||
"name": "carbonator", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Carbonate your web pages.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,5 +49,7 @@ # Carbonator | ||
| `hotspotRespawnRate` | chance per frame that hotspot will be deleted and regenerated at a different location | `1 / (24 * 10)` (about every 10 seconds) | | ||
| `beforeDraw` | `function` to call before drawing each frame (passed `CanvasRenderingContext2D`) | `undefined` | | ||
| `afterDraw` | `function` to call after drawing each frame (passed `CanvasRenderingContext2D`) | `undefined` | | ||
| `beforeDraw` | `function` to call before drawing each frame (passed `CanvasRenderingContext2D`) † | `undefined` | | ||
| `afterDraw` | `function` to call after drawing each frame (passed `CanvasRenderingContext2D`) † | `undefined` | | ||
† callbacks are bound to the `Carbonator` instance; internal properties may therefore be accessed through `this`, but such behavior may be subject to breaking changes | ||
### You Might Not Need JQuery | ||
@@ -54,0 +56,0 @@ |
10960
206
65