src/main/java/com/spinyowl/legui/component/misc/listener/scrollbar/ScrollBarMouseClickEventListener.java
private void updateViewport(Event event, ScrollBar scrollBar, float maxValue, float minValue,
      float newValue) {
    float valueToUse = newValue;
    if (newValue > maxValue) {
      valueToUse = maxValue;
    } else if (newValue < minValue) {
      valueToUse = minValue;
    }
    Context context = event.getContext();
    Frame frame = event.getFrame();
    float curValue = scrollBar.getCurValue();
    EventProcessorProvider.getInstance().pushEvent(
        new ScrollBarChangeValueEvent<>(scrollBar, context, frame, curValue, valueToUse));
    scrollBar.setCurValue(valueToUse);
  }
/**
   * Used to update viewport.
   *
   * @param event     event.
   * @param scrollBar scrollbar.
   * @param maxValue  maximum scrollbar value.
   * @param minValue  minimum scrollbar value.
   * @param newValue  new scrollbar value.
   */
Used to update viewport.
@param event     event.
@param scrollBar scrollbar.
@param maxValue  maximum scrollbar value.
@param minValue  minimum scrollbar value.
@param newValue  new scrollbar value.
Used to update viewport . @param event event . @param scrollBar scrollbar . @param maxValue maximum scrollbar value . @param minValue minimum scrollbar value . @param newValue new scrollbar value .
private void updateViewport(Event event, ScrollBar scrollBar, float maxValue, float minValue,
      float newValue) {
    float valueToUse = newValue;
    if (newValue > maxValue) {
      valueToUse = maxValue;
    } else if (newValue < minValue) {
      valueToUse = minValue;
    }
    Context context = event.getContext();
    Frame frame = event.getFrame();
    float curValue = scrollBar.getCurValue();
    EventProcessorProvider.getInstance().pushEvent(
        new ScrollBarChangeValueEvent<>(scrollBar, context, frame, curValue, valueToUse));
    scrollBar.setCurValue(valueToUse);
  }
private void updateViewport ( Event event , ScrollBar scrollBar , float maxValue , float minValue , float newValue ) { float valueToUse = newValue ; if ( newValue > maxValue ) { valueToUse = maxValue ; } else if ( newValue < minValue ) { valueToUse = minValue ; } Context context = event . getContext ( ) ; Frame frame = event . getFrame ( ) ; float curValue = scrollBar . getCurValue ( ) ; EventProcessorProvider . getInstance ( ) . pushEvent ( new ScrollBarChangeValueEvent < > ( scrollBar , context , frame , curValue , valueToUse ) ) ; scrollBar . setCurValue ( valueToUse ) ; }
Used to update viewport.
Used to update viewport .