handleScroll method

void handleScroll(
  1. RenderViewModel view,
  2. double scrollX,
  3. double scrollY
)

Implementation

void handleScroll(RenderViewModel view, double scrollX, double scrollY) {
  if (scrollEventEnable) {
    var costTime = 0;
    if (stopwatch.isRunning) {
      costTime = stopwatch.elapsedMilliseconds;
      if (costTime < scrollEventThrottle && costTime != 0) {
        return;
      }
    }

    _ScrollEventHelper.emitScrollEvent(view, scrollX, scrollY);
    stopwatch.reset();
    stopwatch.start();
  }
}