private void scrollTo(@NotNull Point targetLocation, @NotNull ScrollType scrollType) {
    AnimatedScrollingRunnable canceledThread = cancelAnimatedScrolling(false);
    Rectangle viewRect = canceledThread == null ? getVisibleArea() : canceledThread.getTargetVisibleArea();

    // the model knows nothing about the sticky panel rendering on top of the editor
    // we should adjust target and view rectangle to avoid hidden caret by the sticky panel
    targetLocation = stickyPanelAdjust(targetLocation, viewRect);

    Point p = calcOffsetsToScroll(targetLocation, scrollType, viewRect);
    scroll(p.x, p.y);
  }
private void scrollTo(@NotNull Point targetLocation, @NotNull ScrollType scrollType)