@gush/candybar
Advanced tools
Comparing version 0.0.0-alpha30 to 0.0.0-alpha31
@@ -421,3 +421,4 @@ 'use strict'; | ||
entities = _ref$entities === undefined ? [] : _ref$entities, | ||
hasPointer = _ref.hasPointer; | ||
hasPointer = _ref.hasPointer, | ||
pauseInBackground = _ref.pauseInBackground; | ||
classCallCheck(this, Canvas); | ||
@@ -433,2 +434,11 @@ | ||
this.stop = function () { | ||
_this.paused = true; | ||
}; | ||
this.start = function () { | ||
_this.paused = false; | ||
_this.render(); | ||
}; | ||
this.render = function () { | ||
@@ -452,2 +462,3 @@ // Draw and Update items here. | ||
this.hasPointer = hasPointer; | ||
this.pauseInBackground = pauseInBackground; | ||
@@ -485,2 +496,7 @@ this.dpr = window.devicePixelRatio || 1; | ||
}); | ||
if (this.pauseInBackground) { | ||
window.addEventListener('blur', this.stop); | ||
window.addEventListener('focus', this.start); | ||
} | ||
} | ||
@@ -573,13 +589,2 @@ }, { | ||
}, { | ||
key: 'stop', | ||
value: function stop() { | ||
this.paused = true; | ||
} | ||
}, { | ||
key: 'start', | ||
value: function start() { | ||
this.paused = false; | ||
this.render(); | ||
} | ||
}, { | ||
key: 'clearCanvas', | ||
@@ -727,2 +732,3 @@ value: function clearCanvas(_ref6) { | ||
(_bounds = this.bounds).move.apply(_bounds, arguments); | ||
return this; | ||
} | ||
@@ -729,0 +735,0 @@ }]); |
{ | ||
"name": "@gush/candybar", | ||
"version": "0.0.0-alpha30", | ||
"version": "0.0.0-alpha31", | ||
"description": "🍫", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
370385
704
0