src/main/java/com/spinyowl/legui/system/renderer/nvg/NvgIconRenderer.java
protected Vector2f calculateIconPosition(I icon, Component component, Vector2f iconSize) {
    Vector2f size = component.getSize();

    Vector2f p = new Vector2f(component.getAbsolutePosition());
    if (icon.getPosition() == null) {
      p.x += icon.getHorizontalAlign().index * (size.x - iconSize.x) / 2f;
      p.y += icon.getVerticalAlign().index * (size.y - iconSize.y) / 2f;
    } else {
      p.x += icon.getPosition().x;
      p.y += icon.getPosition().y;
    }
    return p;
  }
/**
   * Used to calculate on screen position of icon.
   *
   * @param icon      icon
   * @param component icon component
   * @param iconSize  icon size
   * @return icon position
   */
Used to calculate on screen position of icon.
Used to calculate on screen position of icon .
protected Vector2f calculateIconPosition(I icon, Component component, Vector2f iconSize) {
    Vector2f size = component.getSize();
    Vector2f p = new Vector2f(component.getAbsolutePosition());
    if (icon.getPosition() == null) {
      p.x += icon.getHorizontalAlign().index * (size.x - iconSize.x) / 2f;
      p.y += icon.getVerticalAlign().index * (size.y - iconSize.y) / 2f;
    } else {
      p.x += icon.getPosition().x;
      p.y += icon.getPosition().y;
    }
    return p;
  }
protected Vector2f calculateIconPosition ( I icon , Component component , Vector2f iconSize ) { Vector2f size = component . getSize ( ) ; Vector2f p = new Vector2f ( component . getAbsolutePosition ( ) ) ; if ( icon . getPosition ( ) == null ) { p . x += icon . getHorizontalAlign ( ) . index * ( size . x - iconSize . x ) / 2f ; p . y += icon . getVerticalAlign ( ) . index * ( size . y - iconSize . y ) / 2f ; } else { p . x += icon . getPosition ( ) . x ; p . y += icon . getPosition ( ) . y ; } return p ; }
Used to calculate on screen position of icon.
Used to calculate on screen position of icon .