src/main/java/com/spinyowl/legui/system/renderer/nvg/util/NvgRenderUtils.java
public static void createScissorByParent(long context, Component parent) {
    List<Component> parents = new ArrayList<>();
    while (parent != null) {
      parents.add(parent);
      parent = parent.getParent();
    }
    Vector2f pos = new Vector2f();
    int size = parents.size();
    if (size > 0) {
      parent = parents.get(size - 1);
      pos.add(parent.getPosition());
      Vector2f s = parent.getSize();
      createScissor(context, new Vector4f(pos, s.x, s.y));
      if (size > 1) {
        for (int i = size - 2; i >= 0; i--) {
          parent = parents.get(i);
          s = parent.getSize();
          pos.add(parent.getPosition());
          nvgIntersectScissor(context, pos.x, pos.y, s.x, s.y);
        }
      }
    }
  }
/**
   * Creates scissor by provided component and it's parent components.
   *
   * @param context nanovg context.
   * @param parent  parent component.
   */
Creates scissor by provided component and it's parent components.
@param context nanovg context.
@param parent  parent component.
Creates scissor by provided component and it ' s parent components . @param context nanovg context . @param parent parent component .
public static void createScissorByParent(long context, Component parent) {
    List<Component> parents = new ArrayList<>();
    while (parent != null) {
      parents.add(parent);
      parent = parent.getParent();
    }
    Vector2f pos = new Vector2f();
    int size = parents.size();
    if (size > 0) {
      parent = parents.get(size - 1);
      pos.add(parent.getPosition());
      Vector2f s = parent.getSize();
      createScissor(context, new Vector4f(pos, s.x, s.y));
      if (size > 1) {
        for (int i = size - 2; i >= 0; i--) {
          parent = parents.get(i);
          s = parent.getSize();
          pos.add(parent.getPosition());
          nvgIntersectScissor(context, pos.x, pos.y, s.x, s.y);
        }
      }
    }
  }
public static void createScissorByParent ( long context , Component parent ) { List < Component > parents = new ArrayList < > ( ) ; while ( parent != null ) { parents . add ( parent ) ; parent = parent . getParent ( ) ; } Vector2f pos = new Vector2f ( ) ; int size = parents . size ( ) ; if ( size > 0 ) { parent = parents . get ( size - 1 ) ; pos . add ( parent . getPosition ( ) ) ; Vector2f s = parent . getSize ( ) ; createScissor ( context , new Vector4f ( pos , s . x , s . y ) ) ; if ( size > 1 ) { for ( int i = size - 2 ; i >= 0 ; i -- ) { parent = parents . get ( i ) ; s = parent . getSize ( ) ; pos . add ( parent . getPosition ( ) ) ; nvgIntersectScissor ( context , pos . x , pos . y , s . x , s . y ) ; } } } }
Creates scissor by provided component and it's parent components.
Creates scissor by provided component and it ' s parent components .