From 7202f497dbd9677e8e17550411593fa5eb2b8210 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 2 Jul 2014 09:30:44 -0600 Subject: [PATCH] Pause scroll view measurement in requestAnimationFrame helper method --- src/editor-component.coffee | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/editor-component.coffee b/src/editor-component.coffee index 917a8202c..e101e00f4 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -219,6 +219,7 @@ EditorComponent = React.createClass requestAnimationFrame: (fn) -> @updatesPaused = true + @pauseScrollViewMeasurement() requestAnimationFrame => fn() @updatesPaused = false @@ -533,7 +534,6 @@ EditorComponent = React.createClass animationFramePending = @pendingScrollTop? @pendingScrollTop = scrollTop unless animationFramePending - @pauseScrollViewMeasurement() @requestAnimationFrame => pendingScrollTop = @pendingScrollTop @pendingScrollTop = null @@ -547,7 +547,6 @@ EditorComponent = React.createClass animationFramePending = @pendingScrollLeft? @pendingScrollLeft = scrollLeft unless animationFramePending - @pauseScrollViewMeasurement() @requestAnimationFrame => @props.editor.setScrollLeft(@pendingScrollLeft) @pendingScrollLeft = null @@ -569,7 +568,6 @@ EditorComponent = React.createClass @clearMouseWheelScreenRowAfterDelay() unless animationFramePending - @pauseScrollViewMeasurement() @requestAnimationFrame => {editor} = @props editor.setScrollTop(editor.getScrollTop() + @pendingVerticalScrollDelta) @@ -698,7 +696,6 @@ EditorComponent = React.createClass dragging = false lastMousePosition = {} animationLoop = => - @pauseScrollViewMeasurement() @requestAnimationFrame => if dragging screenPosition = @screenPositionForMouseEvent(lastMousePosition) @@ -740,7 +737,7 @@ EditorComponent = React.createClass return if @scrollViewMeasurementRequested @scrollViewMeasurementRequested = true - @requestAnimationFrame => + requestAnimationFrame => @scrollViewMeasurementRequested = false @measureScrollView()