     if Session.get 'backgroundPaused'
       # Remember the time when we were paused
       @pausedTime = time
-      # And react to the change of backgroundPaused
-      @autorunHandle = Deps.autorun =>
-        unless Session.get 'backgroundPaused'
-          # Cleanup after resume
-          @autorunHandle.stop()
-          @autorunHandle = null
-          # Restart the loop
-          frame @draw
+      if not @autorunHandle # autorunHandle is set if we are calling this from resize while paused
+        # And react to the change of backgroundPaused
+        @autorunHandle = Deps.autorun =>
+          unless Session.get 'backgroundPaused'
+            # Cleanup after resume
+            @autorunHandle.stop()
+            @autorunHandle = null
+            # Restart the loop
+            frame @draw
       return
 
     frame @draw

    @resizeView()
    @generateTriangles()

    return # Make sure CoffeeScript does not return anything

  resizeView: =>


    return # To not have CoffeeScript return a result of for loop

  # Is called regularly from requestAnimationFrame or from resize while paused
  draw: (time) =>
    return unless @renderer

