From 2074326237090e7acb657145fd794f5393ec88ca Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 4 Dec 2014 16:52:11 +0000 Subject: [PATCH] render pdf pages in ascending order, fix bug where pages could be left unrendered --- .../coffee/ide/pdfng/directives/pdfRenderer.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee index f9e442e003..e961f02a3c 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee @@ -83,11 +83,14 @@ define [ processRenderQueue: () -> return if @jobs > 0 - current = @renderQueue.pop() + current = @renderQueue.shift() return unless current? [element, pagenum] = [current.element, current.pagenum] - return if @complete[pagenum] - return if @renderTask[pagenum] + # if task is underway or complete, go to the next entry in the + # render queue + if @renderTask[pagenum] or @complete[pagenum] + @processRenderQueue() + return @jobs = @jobs + 1 # @addSpinner(element.canvas)