Class Rect

  • Direct Known Subclasses:
    RRect

    public class Rect
    extends java.lang.Object
    • Field Detail

      • _left

        public final float _left
      • _top

        public final float _top
      • _right

        public final float _right
      • _bottom

        public final float _bottom
    • Constructor Detail

      • Rect

        @Internal
        public Rect​(float l,
                    float t,
                    float r,
                    float b)
    • Method Detail

      • getWidth

        public float getWidth()
      • getHeight

        public float getHeight()
      • withWidth

        @NotNull
        @Contract("_ -> new")
        public @NotNull Rect withWidth​(float width)
      • withHeight

        @NotNull
        @Contract("_ -> new")
        public @NotNull Rect withHeight​(float height)
      • makeLTRB

        @NotNull
        @Contract("_, _, _, _ -> new")
        public static @NotNull Rect makeLTRB​(float l,
                                             float t,
                                             float r,
                                             float b)
      • makeWH

        @NotNull
        @Contract("_, _ -> new")
        public static @NotNull Rect makeWH​(float w,
                                           float h)
      • makeWH

        @NotNull
        @Contract("_, _ -> new")
        public static @NotNull Rect makeWH​(@NotNull
                                           @NotNull Point size)
      • makeXYWH

        @NotNull
        @Contract("_, _, _, _ -> new")
        public static @NotNull Rect makeXYWH​(float l,
                                             float t,
                                             float w,
                                             float h)
      • intersect

        @Nullable
        public @Nullable Rect intersect​(@NotNull
                                        @NotNull Rect other)
      • scale

        @NotNull
        public @NotNull Rect scale​(float scale)
      • scale

        @NotNull
        public @NotNull Rect scale​(float sx,
                                   float sy)
      • offset

        @NotNull
        public @NotNull Rect offset​(float dx,
                                    float dy)
      • offset

        @NotNull
        public @NotNull Rect offset​(@NotNull
                                    @NotNull Point vec)
      • toIRect

        @NotNull
        @Contract("-> new")
        public @NotNull IRect toIRect()
      • withRadii

        @NotNull
        @Contract("_ -> new")
        public @NotNull RRect withRadii​(float radius)
      • withRadii

        @NotNull
        @Contract("_, _ -> new")
        public @NotNull RRect withRadii​(float xRad,
                                        float yRad)
      • withRadii

        @NotNull
        @Contract("_ -> new")
        public @NotNull RRect withRadii​(float tlRad,
                                        float trRad,
                                        float brRad,
                                        float blRad)
      • withRadii

        @NotNull
        @Contract("_ -> new")
        public @NotNull RRect withRadii​(float[] radii)
      • inflate

        @NotNull
        public @NotNull Rect inflate​(float spread)
      • isEmpty

        public boolean isEmpty()
      • getLeft

        public float getLeft()
      • getTop

        public float getTop()
      • getRight

        public float getRight()
      • getBottom

        public float getBottom()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • withLeft

        public Rect withLeft​(float _left)
        Returns:
        this.
      • withTop

        public Rect withTop​(float _top)
        Returns:
        this.
      • withRight

        public Rect withRight​(float _right)
        Returns:
        this.
      • withBottom

        public Rect withBottom​(float _bottom)
        Returns:
        this.