Record Class GuiCornerRadii
java.lang.Object
java.lang.Record
com.render.api.gui.paint.GuiCornerRadii
- Record Components:
topLeftX- top-left horizontal radiustopLeftY- top-left vertical radiustopRightX- top-right horizontal radiustopRightY- top-right vertical radiusbottomRightX- bottom-right horizontal radiusbottomRightY- bottom-right vertical radiusbottomLeftX- bottom-left horizontal radiusbottomLeftY- bottom-left vertical radius
public record GuiCornerRadii(float topLeftX, float topLeftY, float topRightX, float topRightY, float bottomRightX, float bottomRightY, float bottomLeftX, float bottomLeftY)
extends Record
Independent elliptical radii for all four corners.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuiCornerRadii(float topLeftX, float topLeftY, float topRightX, float topRightY, float bottomRightX, float bottomRightY, float bottomLeftX, float bottomLeftY) Creates an instance of aGuiCornerRadiirecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thebottomLeftXrecord component.floatReturns the value of thebottomLeftYrecord component.floatReturns the value of thebottomRightXrecord component.floatReturns the value of thebottomRightYrecord component.static GuiCornerRadiielliptical(float horizontal, float vertical) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleannormalized(float width, float height) Applies the CSS corner-overlap reduction rule for the supplied border box.static GuiCornerRadiionlyBottomLeft(float radius) Creates a circular bottom-left corner and square remaining corners.static GuiCornerRadiionlyBottomRight(float radius) Creates a circular bottom-right corner and square remaining corners.static GuiCornerRadiionlyTopLeft(float radius) Creates a circular top-left corner and square remaining corners.static GuiCornerRadiionlyTopRight(float radius) Creates a circular top-right corner and square remaining corners.floattopLeftX()Returns the value of thetopLeftXrecord component.floattopLeftY()Returns the value of thetopLeftYrecord component.floatReturns the value of thetopRightXrecord component.floatReturns the value of thetopRightYrecord component.final StringtoString()Returns a string representation of this record class.static GuiCornerRadiiuniform(float radius) floatwithBottomLeft(float horizontal, float vertical) Replaces the bottom-left elliptical radii.withBottomRight(float horizontal, float vertical) Replaces the bottom-right elliptical radii.withTopLeft(float horizontal, float vertical) Replaces the top-left elliptical radii.withTopRight(float horizontal, float vertical) Replaces the top-right elliptical radii.
-
Field Details
-
ZERO
-
-
Constructor Details
-
GuiCornerRadii
public GuiCornerRadii(float topLeftX, float topLeftY, float topRightX, float topRightY, float bottomRightX, float bottomRightY, float bottomLeftX, float bottomLeftY) Creates an instance of aGuiCornerRadiirecord class.- Parameters:
topLeftX- the value for thetopLeftXrecord componenttopLeftY- the value for thetopLeftYrecord componenttopRightX- the value for thetopRightXrecord componenttopRightY- the value for thetopRightYrecord componentbottomRightX- the value for thebottomRightXrecord componentbottomRightY- the value for thebottomRightYrecord componentbottomLeftX- the value for thebottomLeftXrecord componentbottomLeftY- the value for thebottomLeftYrecord component
-
-
Method Details
-
uniform
-
elliptical
-
onlyTopLeft
Creates a circular top-left corner and square remaining corners.- Parameters:
radius- top-left radius- Returns:
- independent corner radii
-
onlyTopRight
Creates a circular top-right corner and square remaining corners.- Parameters:
radius- top-right radius- Returns:
- independent corner radii
-
onlyBottomRight
Creates a circular bottom-right corner and square remaining corners.- Parameters:
radius- bottom-right radius- Returns:
- independent corner radii
-
onlyBottomLeft
Creates a circular bottom-left corner and square remaining corners.- Parameters:
radius- bottom-left radius- Returns:
- independent corner radii
-
withTopLeft
Replaces the top-left elliptical radii.- Parameters:
horizontal- horizontal radiusvertical- vertical radius- Returns:
- updated radii
-
withTopRight
Replaces the top-right elliptical radii.- Parameters:
horizontal- horizontal radiusvertical- vertical radius- Returns:
- updated radii
-
withBottomRight
Replaces the bottom-right elliptical radii.- Parameters:
horizontal- horizontal radiusvertical- vertical radius- Returns:
- updated radii
-
withBottomLeft
Replaces the bottom-left elliptical radii.- Parameters:
horizontal- horizontal radiusvertical- vertical radius- Returns:
- updated radii
-
isUniformCircular
public boolean isUniformCircular() -
uniformRadius
public float uniformRadius() -
normalized
Applies the CSS corner-overlap reduction rule for the supplied border box.All radii share one scale factor, so adjacent horizontal or vertical radii never overlap and the authored corner proportions are preserved.
- Parameters:
width- border-box widthheight- border-box height- Returns:
- normalized radii
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
topLeftX
-
topLeftY
-
topRightX
-
topRightY
-
bottomRightX
public float bottomRightX()Returns the value of thebottomRightXrecord component.- Returns:
- the value of the
bottomRightXrecord component
-
bottomRightY
public float bottomRightY()Returns the value of thebottomRightYrecord component.- Returns:
- the value of the
bottomRightYrecord component
-
bottomLeftX
public float bottomLeftX()Returns the value of thebottomLeftXrecord component.- Returns:
- the value of the
bottomLeftXrecord component
-
bottomLeftY
public float bottomLeftY()Returns the value of thebottomLeftYrecord component.- Returns:
- the value of the
bottomLeftYrecord component
-