src/main/java/com/spinyowl/legui/component/misc/listener/scrollablepanel/ScrollablePanelViewportScrollListener.java
@Override
  public void process(ScrollEvent event) {
    Vector2f cursorPosition = Mouse.getCursorPosition();
    Component targetComponent = event.getTargetComponent();

    if (hasViewportsInAboveLayersUnderCursor(targetComponent, cursorPosition)) {
      return;
    }
    if (hasScrollableInChildComponentsUnderCursor(targetComponent, cursorPosition)) {
      return;
    }

    ScrollablePanel scrollablePanel = (ScrollablePanel) targetComponent.getParent();

    if (Math.abs(event.getYoffset()) > 0) {
      updateScrollBarValue(event.getYoffset(), event.getContext(), event.getFrame(),
          scrollablePanel.getVerticalScrollBar());
    }
    if (Math.abs(event.getXoffset()) > 0) {
      updateScrollBarValue(event.getXoffset(), event.getContext(), event.getFrame(),
          scrollablePanel.getHorizontalScrollBar());
    }
  }
/**
   * Used to handle specific event.
   *
   * @param event event to handle.
   */
Used to handle specific event.
@param event event to handle.
Used to handle specific event . @param event event to handle .
@Override
  public void process(ScrollEvent event) {
    Vector2f cursorPosition = Mouse.getCursorPosition();
    Component targetComponent = event.getTargetComponent();
    if (hasViewportsInAboveLayersUnderCursor(targetComponent, cursorPosition)) {
      return;
    }
    if (hasScrollableInChildComponentsUnderCursor(targetComponent, cursorPosition)) {
      return;
    }
    ScrollablePanel scrollablePanel = (ScrollablePanel) targetComponent.getParent();
    if (Math.abs(event.getYoffset()) > 0) {
      updateScrollBarValue(event.getYoffset(), event.getContext(), event.getFrame(),
          scrollablePanel.getVerticalScrollBar());
    }
    if (Math.abs(event.getXoffset()) > 0) {
      updateScrollBarValue(event.getXoffset(), event.getContext(), event.getFrame(),
          scrollablePanel.getHorizontalScrollBar());
    }
  }
@ Override public void process ( ScrollEvent event ) { Vector2f cursorPosition = Mouse . getCursorPosition ( ) ; Component targetComponent = event . getTargetComponent ( ) ; if ( hasViewportsInAboveLayersUnderCursor ( targetComponent , cursorPosition ) ) { return ; } if ( hasScrollableInChildComponentsUnderCursor ( targetComponent , cursorPosition ) ) { return ; } ScrollablePanel scrollablePanel = ( ScrollablePanel ) targetComponent . getParent ( ) ; if ( Math . abs ( event . getYoffset ( ) ) > 0 ) { updateScrollBarValue ( event . getYoffset ( ) , event . getContext ( ) , event . getFrame ( ) , scrollablePanel . getVerticalScrollBar ( ) ) ; } if ( Math . abs ( event . getXoffset ( ) ) > 0 ) { updateScrollBarValue ( event . getXoffset ( ) , event . getContext ( ) , event . getFrame ( ) , scrollablePanel . getHorizontalScrollBar ( ) ) ; } }
Used to handle specific event.
Used to handle specific event .