Skip to content

Commit

Permalink
fix #6 - shouldn't destructure transition if none passed
Browse files Browse the repository at this point in the history
  • Loading branch information
aeroheim committed Jun 21, 2020
1 parent 9dbe5a6 commit ffb3ee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/background-renderer.ts
Expand Up @@ -132,11 +132,11 @@ class BackgroundRenderer {
* @param {Transition} transition - optional configuration for a transition.
*/
setBackground(texture: Texture, transition?: Transition) {
const { type, config: { onStart = () => ({}), ...transitionConfig } } = transition;
const { clientWidth: width, clientHeight: height } = this._renderer.domElement;
this._background = new Background(texture, width, height);

if (transition) {
const { type, config: { onStart = () => ({}), ...transitionConfig } } = transition;
this._transitionPass.transition(this._background, type as any, {
...transitionConfig,
onStart: (prevBackground, nextBackground) => {
Expand Down

0 comments on commit ffb3ee0

Please sign in to comment.