 						ctrl.setScale(scale, h, w).then () ->
 							spinner.remove(element)
 							ctrl.redraw(origposition)
+							$timeout renderVisiblePages, 0
 
 				checkElementReady = () ->
 					# if element is zero-sized keep checking until it is ready

						pageTop = pageElement.offset().top
						pageBottom = pageTop + pageElement.innerHeight()
						return pageTop < bottom and pageBottom > top
					return (page for page in scope.pages when isVisible(page.element))

				getExtraPages = (visiblePages) ->
					extra = []


				element.on 'scroll', () ->
					#console.log 'scroll event', element.scrollTop(), 'adjusting?', scope.adjustingScroll
					#scope.scrollPosition = element.scrollTop()
					if scope.adjustingScroll
						renderVisiblePages()
						# updateContainer()
						scope.$apply()
						scope.adjustingScroll = false
						return
					#scope.scrolled = true
					if scope.scrollHandlerTimeout
						$timeout.cancel(scope.scrollHandlerTimeout)
					scope.scrollHandlerTimeout = $timeout scrollHandler, 25

				scrollHandler = () ->
					renderVisiblePages()
					scope.$apply()
					newPosition = ctrl.getPdfPosition()
					if newPosition?
