src/main/java/com/spinyowl/legui/system/renderer/nvg/util/NvgShapes.java
public static void drawRect(long nvg, Vector2fc position, Vector2fc size, Vector4fc bgColor,
      Vector4f radius) {
    if (radius != null && !radius.equals(ZERO_CORNDERS)) {
      try (NVGColor fillColor = NvgColorUtil.create(bgColor)) {
        nvgBeginPath(nvg);
        nvgFillColor(nvg, fillColor);
        if (radius.x == radius.y && radius.x == radius.z && radius.x == radius.w) {
          nvgRoundedRect(nvg, position.x(), position.y(), size.x(), size.y(), radius.x);
        } else {
          nvgRoundedRectVarying(nvg, position.x(), position.y(), size.x(), size.y(), radius.x,
              radius.y, radius.z, radius.w);
        }
        nvgFill(nvg);
      }
    } else {
      drawRect(nvg, position, size, bgColor);
    }
  }
/**
   * Used to draw rectangle.
   *
   * @param nvg      nanovg context.
   * @param position rectangle position.
   * @param size     rectangle size.
   * @param bgColor  rectangle background color.
   * @param radius   cornder radius
   */
Used to draw rectangle.
@param nvg      nanovg context.
@param position rectangle position.
@param size     rectangle size.
@param bgColor  rectangle background color.
@param radius   cornder radius
Used to draw rectangle . @param nvg nanovg context . @param position rectangle position . @param size rectangle size . @param bgColor rectangle background color . @param radius cornder radius
public static void drawRect(long nvg, Vector2fc position, Vector2fc size, Vector4fc bgColor,
      Vector4f radius) {
    if (radius != null && !radius.equals(ZERO_CORNDERS)) {
      try (NVGColor fillColor = NvgColorUtil.create(bgColor)) {
        nvgBeginPath(nvg);
        nvgFillColor(nvg, fillColor);
        if (radius.x == radius.y && radius.x == radius.z && radius.x == radius.w) {
          nvgRoundedRect(nvg, position.x(), position.y(), size.x(), size.y(), radius.x);
        } else {
          nvgRoundedRectVarying(nvg, position.x(), position.y(), size.x(), size.y(), radius.x,
              radius.y, radius.z, radius.w);
        }
        nvgFill(nvg);
      }
    } else {
      drawRect(nvg, position, size, bgColor);
    }
  }
public static void drawRect ( long nvg , Vector2fc position , Vector2fc size , Vector4fc bgColor , Vector4f radius ) { if ( radius != null && ! radius . equals ( ZERO_CORNDERS ) ) { try ( NVGColor fillColor = NvgColorUtil . create ( bgColor ) ) { nvgBeginPath ( nvg ) ; nvgFillColor ( nvg , fillColor ) ; if ( radius . x == radius . y && radius . x == radius . z && radius . x == radius . w ) { nvgRoundedRect ( nvg , position . x ( ) , position . y ( ) , size . x ( ) , size . y ( ) , radius . x ) ; } else { nvgRoundedRectVarying ( nvg , position . x ( ) , position . y ( ) , size . x ( ) , size . y ( ) , radius . x , radius . y , radius . z , radius . w ) ; } nvgFill ( nvg ) ; } } else { drawRect ( nvg , position , size , bgColor ) ; } }
Used to draw rectangle.
Used to draw rectangle .