src/main/java/com/spinyowl/legui/system/renderer/nvg/component/NvgTextInputRenderer.java
@Override
  protected void renderSelf(TextInput component, Context context, long nanovg) {
    runWithScissor(nanovg, component, () -> {
      Vector2f pos = component.getAbsolutePosition();
      Vector2f size = component.getSize();
      boolean enabled = component.isEnabled();
      Style style = component.getStyle();
      Vector4f bc = new Vector4f(style.getBackground().getColor());

      if (enabled && component.isFocused()) {
        bc.w *= 1.1f;
      } else if (!enabled) {
        bc.w *= 0.5f;
      }
      if (!component.isEditable()) {
        bc.w *= 0.3f;
      }
      renderBackground(component, context, nanovg);

      Vector4f padding = getPadding(component, style);
      Vector4f intersectRect = getInnerContentRectangle(pos, size, padding);
      intersectScissor(nanovg, new Vector4f(intersectRect).sub(1, 1, -2, -2));
      renderText(context, nanovg, component, size, intersectRect, bc);
    });
  }
/**
   * Used to render textInput.
   *
   * @param component textInput to render.
   * @param context   legui context.
   * @param nanovg    nanovg context pointer.
   */
Used to render textInput.
@param component textInput to render.
@param context   legui context.
@param nanovg    nanovg context pointer.
Used to render textInput . @param component textInput to render . @param context legui context . @param nanovg nanovg context pointer .
@Override
  protected void renderSelf(TextInput component, Context context, long nanovg) {
    runWithScissor(nanovg, component, () -> {
      Vector2f pos = component.getAbsolutePosition();
      Vector2f size = component.getSize();
      boolean enabled = component.isEnabled();
      Style style = component.getStyle();
      Vector4f bc = new Vector4f(style.getBackground().getColor());
      if (enabled && component.isFocused()) {
        bc.w *= 1.1f;
      } else if (!enabled) {
        bc.w *= 0.5f;
      }
      if (!component.isEditable()) {
        bc.w *= 0.3f;
      }
      renderBackground(component, context, nanovg);
      Vector4f padding = getPadding(component, style);
      Vector4f intersectRect = getInnerContentRectangle(pos, size, padding);
      intersectScissor(nanovg, new Vector4f(intersectRect).sub(1, 1, -2, -2));
      renderText(context, nanovg, component, size, intersectRect, bc);
    });
  }
@ Override protected void renderSelf ( TextInput component , Context context , long nanovg ) { runWithScissor ( nanovg , component , ( ) -> { Vector2f pos = component . getAbsolutePosition ( ) ; Vector2f size = component . getSize ( ) ; boolean enabled = component . isEnabled ( ) ; Style style = component . getStyle ( ) ; Vector4f bc = new Vector4f ( style . getBackground ( ) . getColor ( ) ) ; if ( enabled && component . isFocused ( ) ) { bc . w *= 1.1f ; } else if ( ! enabled ) { bc . w *= 0.5f ; } if ( ! component . isEditable ( ) ) { bc . w *= 0.3f ; } renderBackground ( component , context , nanovg ) ; Vector4f padding = getPadding ( component , style ) ; Vector4f intersectRect = getInnerContentRectangle ( pos , size , padding ) ; intersectScissor ( nanovg , new Vector4f ( intersectRect ) . sub ( 1 , 1 , - 2 , - 2 ) ) ; renderText ( context , nanovg , component , size , intersectRect , bc ) ; } ) ; }
Used to render textInput.
Used to render textInput .