Class AreasBI
Functions over areas.
These functions operate using the concepts of minimum-x, maximum-x, minimum-y, and maximum-y edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x and "top" for minimum-y.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AreaBI
alignCenter
(AreaBI outer, AreaBI inner) Align the areainner
such that the center of the area is equal to the center ofouter
.static AreaBI
alignHorizontallyCenter
(AreaBI outer, AreaBI inner) Deprecated.static AreaBI
alignHorizontallyMaxX
(AreaBI outer, AreaBI inner) Deprecated.static AreaBI
alignHorizontallyMaxXOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.static AreaBI
alignHorizontallyMinX
(AreaBI outer, AreaBI inner) Deprecated.static AreaBI
alignHorizontallyMinXOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.static AreaBI
alignMaxYMaxX
(AreaBI outer, AreaBI inner) Equivalent to callingalignMaxYMaxXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.static AreaBI
alignMaxYMaxXOffset
(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the maximum-y edge is at leastoffset_y
from the inside maximum-y edge ofouter
and the maximum-x edge is at leastoffset_x
from the inside maximum-x edge ofouter
.static AreaBI
alignMaxYMinX
(AreaBI outer, AreaBI inner) Equivalent to callingalignMaxYMinXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.static AreaBI
alignMaxYMinXOffset
(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the maximum-y edge is at leastoffset_y
from the inside maximum-y edge ofouter
and the minimum-x edge is at leastoffset_x
from the inside minimum-x edge ofouter
.static AreaBI
alignMinYMaxX
(AreaBI outer, AreaBI inner) Equivalent to callingalignMinYMaxXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.static AreaBI
alignMinYMaxXOffset
(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the minimum-y edge is at leastoffset_y
from the inside minimum-y edge ofouter
and the maximum-x edge is at leastoffset_x
from the inside maximum-x edge ofouter
.static AreaBI
alignMinYMinX
(AreaBI outer, AreaBI inner) Equivalent to callingalignMinYMinXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.static AreaBI
alignMinYMinXOffset
(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the minimum-y edge is at leastoffset_y
from the inside minimum-y edge ofouter
and the minimum-x edge is at leastoffset_x
from the inside minimum-x edge ofouter
.static AreaBI
alignOnXCenter
(AreaBI outer, AreaBI inner) Align the areainner
along the X axis in the center ofouter
.static AreaBI
alignOnXMaxX
(AreaBI outer, AreaBI inner) Equivalent to callingalignOnXMaxXOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.static AreaBI
alignOnXMaxXOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Align the areainner
along the X axis against the inside maximum-x edge ofouter
.static AreaBI
alignOnXMinX
(AreaBI outer, AreaBI inner) Equivalent to callingalignOnXMinXOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.static AreaBI
alignOnXMinXOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Align the areainner
along the X axis against the inside minimum-x edge ofouter
.static AreaBI
alignOnYCenter
(AreaBI outer, AreaBI inner) Align the areainner
along the Y axis in the center ofouter
.static AreaBI
alignOnYMaxY
(AreaBI outer, AreaBI inner) Equivalent to callingalignOnYMaxYOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.static AreaBI
alignOnYMaxYOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Align the areainner
along the Y axis against the inside maximum-y edge ofouter
.static AreaBI
alignOnYMinY
(AreaBI outer, AreaBI inner) Equivalent to callingalignOnYMinYOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.static AreaBI
alignOnYMinYOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Align the areainner
along the Y axis against the inside minimum-y edge ofouter
.static AreaBI
alignVerticallyCenter
(AreaBI outer, AreaBI inner) Deprecated.static AreaBI
alignVerticallyMaxY
(AreaBI outer, AreaBI inner) Deprecated.static AreaBI
alignVerticallyMaxYOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.static AreaBI
alignVerticallyMinY
(AreaBI outer, AreaBI inner) Deprecated.static AreaBI
alignVerticallyMinYOffset
(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.static AreaBI
containing
(AreaBI a, AreaBI b) Construct a area that will contain botha
andb
.static boolean
Determine whether or not one area contains another.static boolean
containsPoint
(AreaBI a, BigInteger x, BigInteger y) Determine whether or not a area contains a given point.static boolean
couldFitInside
(AreaBI a, AreaBI b) Determine whether or not one area could fit inside another.static AreaBI
create
(BigInteger x, BigInteger y, BigInteger size_x, BigInteger size_y) Create an area of sizesize_x
on the X axis and sizesize_y
on the Y axis, placing the minimum corner at(x, y)
.static AreaBI
fitBetweenHorizontal
(AreaBI fit, AreaBI a, AreaBI b) Deprecated.static AreaBI
fitBetweenOnX
(AreaBI fit, AreaBI a, AreaBI b) Attempt to fitfit
betweena
andb
, horizontally.static AreaBI
fitBetweenOnY
(AreaBI fit, AreaBI a, AreaBI b) Attempt to fitfit
betweena
andb
, vertically.static AreaBI
fitBetweenVertical
(AreaBI fit, AreaBI a, AreaBI b) Deprecated.static AreaBI
hollowOut
(AreaBI outer, BigInteger min_x_offset, BigInteger max_x_offset, BigInteger min_y_offset, BigInteger max_y_offset) Construct a new area that fits insideouter
based on the given offsets from each edge.static AreaBI
hollowOutEvenly
(AreaBI outer, BigInteger offset) Equivalent to callinghollowOut(AreaBI, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger)
withoffset
for all offset parameters.static AreaBI
moveAbsolute
(AreaBI area, BigInteger x, BigInteger y) Move the given area to(x, y)
.static AreaBI
moveRelative
(AreaBI area, BigInteger x, BigInteger y) Move the given area by(x, y)
.static AreaBI
moveRelativeClamped
(AreaBI container, AreaBI area, BigInteger x, BigInteger y) Move the given area by(x, y)
, without allowingarea
to leavecontainer
.static AreaBI
moveRelativeClampedX
(AreaBI container, AreaBI area, BigInteger x) Move the given area byx
, without allowingarea
to leavecontainer
.static AreaBI
moveRelativeClampedY
(AreaBI container, AreaBI area, BigInteger y) Move the given area byy
, without allowingarea
to leavecontainer
.static AreaBI
moveToOrigin
(AreaBI area) Move the given area to(0, 0)
.static boolean
Determine whether or not two areas overlap.static AreaBI
scaleFromCenter
(AreaBI area, BigInteger x_diff, BigInteger y_diff) Scalearea
by addingx_diff
to the sizeX, andy_diff
to the sizeY.static AreaBI
scaleFromMaxYMaxX
(AreaBI area, BigInteger x_diff, BigInteger y_diff) Scalearea
by addingx_diff
to the sizeX, andy_diff
to the sizeY.static AreaBI
scaleFromMaxYMinX
(AreaBI area, BigInteger x_diff, BigInteger y_diff) Scalearea
by addingx_diff
to the sizeX, andy_diff
to the sizeY.static AreaBI
scaleFromMinYMaxX
(AreaBI area, BigInteger x_diff, BigInteger y_diff) Scalearea
by addingx_diff
to the sizeX, andy_diff
to the sizeY.static AreaBI
scaleFromMinYMinX
(AreaBI area, BigInteger x_diff, BigInteger y_diff) Scalearea
by addingx_diff
to the sizeX, andy_diff
to the sizeY.static AreaBI
setSizeFromCenter
(AreaBI area, BigInteger sizeX, BigInteger sizeY) Set the sizeX and sizeY ofarea
tosizeX
andsizeY
, respectively.static AreaBI
setSizeFromMaxYMaxX
(AreaBI area, BigInteger sizeX, BigInteger sizeY) Set the sizeX and sizeY ofarea
tosizeX
andsizeY
, respectively.static AreaBI
setSizeFromMaxYMinX
(AreaBI area, BigInteger sizeX, BigInteger sizeY) Set the sizeX and sizeY ofarea
tosizeX
andsizeY
, respectively.static AreaBI
setSizeFromMinYMaxX
(AreaBI area, BigInteger sizeX, BigInteger sizeY) Set the sizeX and sizeY ofarea
tosizeX
andsizeY
, respectively.static AreaBI
setSizeFromMinYMinX
(AreaBI area, BigInteger sizeX, BigInteger sizeY) Set the sizeX and sizeY ofarea
tosizeX
andsizeY
, respectively.static String
static String
showToBuilder
(AreaBI area, StringBuilder sb) static AreaSizeBI
static AreaXSplitBI<AreaBI>
splitAlongParallelToX
(AreaBI area, BigInteger y) Splitarea
along a line parallel to the X axis placed aty
units from its own minimum-y edge.static AreaYSplitBI<AreaBI>
splitAlongParallelToY
(AreaBI area, BigInteger x) Splitarea
along a line parallel to the Y axis placed atx
units from its own minimum-x edge.static AreaXYSplitBI<AreaBI>
splitAlongXY
(AreaBI area, BigInteger x, BigInteger y) Splitarea
along a two axis-aligned perpendicular lines that intercept at(x, y)
.
-
Method Details
-
create
Create an area of sizesize_x
on the X axis and sizesize_y
on the Y axis, placing the minimum corner at(x, y)
.- Parameters:
x
- The X value of the minimum cornery
- The Y value of the minimum cornersize_x
- The size of the area on the X axissize_y
- The size of the area on the Y axis- Returns:
- An area
-
contains
Determine whether or not one area contains another.
Containing is reflexive:
contains(a, a) == true
.Containing is transitive:
contains(a, b) → contains(b, c) → contains(a, c)
.Containing is not necessarily symmetric.
- Parameters:
a
- Area Ab
- Area B- Returns:
true
iffa
containsb
-
moveRelative
Move the given area by(x, y)
.- Parameters:
area
- The areax
- The amount to move on the X axisy
- The amount to move on the Y axis- Returns:
- A moved area
-
moveRelativeClampedX
Move the given area byx
, without allowingarea
to leavecontainer
.- Parameters:
container
- The container areaarea
- The areax
- The amount to move on the X axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveRelativeClampedY
Move the given area byy
, without allowingarea
to leavecontainer
.- Parameters:
container
- The container areaarea
- The areay
- The amount to move on the Y axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveRelativeClamped
Move the given area by(x, y)
, without allowingarea
to leavecontainer
.- Parameters:
container
- The container areaarea
- The areax
- The amount to move on the X axisy
- The amount to move on the Y axis- Returns:
- A moved area
- Since:
- 3.0.0
-
moveAbsolute
Move the given area to(x, y)
.- Parameters:
area
- The areax
- The position to which to move on the X axisy
- The position to which to move on the Y axis- Returns:
- A moved area
-
moveToOrigin
Move the given area to(0, 0)
.- Parameters:
area
- The area- Returns:
- A moved area
-
alignOnXCenter
Align the areainner
along the X axis in the center ofouter
.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinX
Equivalent to callingalignOnXMinXOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMinXOffset
Align the areainner
along the X axis against the inside minimum-x edge ofouter
. The area will be at leastoffset
units from the minimum-x edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMaxX
Equivalent to callingalignOnXMaxXOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnXMaxXOffset
Align the areainner
along the X axis against the inside maximum-x edge ofouter
. The area will be at leastoffset
units from the maximum-x edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMinY
Equivalent to callingalignOnYMinYOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMinYOffset
Align the areainner
along the Y axis against the inside minimum-y edge ofouter
. The area will be at leastoffset
units from the minimum-y edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMaxY
Equivalent to callingalignOnYMaxYOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYMaxYOffset
Align the areainner
along the Y axis against the inside maximum-y edge ofouter
. The area will be at leastoffset
units from the maximum-y edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignOnYCenter
Align the areainner
along the Y axis in the center ofouter
.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
- Since:
- 1.1.0
-
alignHorizontallyCenter
Deprecated.Align the areainner
horizontally in the center ofouter
.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinX
Deprecated.Equivalent to callingalignHorizontallyMinXOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignHorizontallyMinXOffset
@Deprecated public static AreaBI alignHorizontallyMinXOffset(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.Align the areainner
horizontally against the inside minimum-x edge ofouter
. The area will be at leastoffset
units from the minimum-x edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
-
alignHorizontallyMaxX
Deprecated.Equivalent to callingalignHorizontallyMaxXOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignHorizontallyMaxXOffset
@Deprecated public static AreaBI alignHorizontallyMaxXOffset(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.Align the areainner
horizontally against the inside maximum-x edge ofouter
. The area will be at leastoffset
units from the maximum-x edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMinY
Deprecated.Equivalent to callingalignVerticallyMinYOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignVerticallyMinYOffset
@Deprecated public static AreaBI alignVerticallyMinYOffset(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.Align the areainner
vertically against the inside minimum-y edge ofouter
. The area will be at leastoffset
units from the minimum-y edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyMaxY
Deprecated.Equivalent to callingalignVerticallyMaxYOffset(AreaBI, AreaBI, java.math.BigInteger)
with a zero offset.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignVerticallyMaxYOffset
@Deprecated public static AreaBI alignVerticallyMaxYOffset(AreaBI outer, AreaBI inner, BigInteger offset) Deprecated.Align the areainner
vertically against the inside maximum-y edge ofouter
. The area will be at leastoffset
units from the maximum-y edge.- Parameters:
outer
- The outer areainner
- The inner areaoffset
- The offset from the edge- Returns:
- An aligned area
-
alignVerticallyCenter
Deprecated.Align the areainner
vertically in the center ofouter
.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignMinYMinX
Equivalent to callingalignMinYMinXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignMinYMinXOffset
public static AreaBI alignMinYMinXOffset(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the minimum-y edge is at leastoffset_y
from the inside minimum-y edge ofouter
and the minimum-x edge is at leastoffset_x
from the inside minimum-x edge ofouter
.- Parameters:
outer
- The outer areainner
- The inner areaoffset_x
- The offset from the minimum-x edgeoffset_y
- The offset from the minimum-y edge- Returns:
- An aligned area
-
alignMinYMaxX
Equivalent to callingalignMinYMaxXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignMinYMaxXOffset
public static AreaBI alignMinYMaxXOffset(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the minimum-y edge is at leastoffset_y
from the inside minimum-y edge ofouter
and the maximum-x edge is at leastoffset_x
from the inside maximum-x edge ofouter
.- Parameters:
outer
- The outer areainner
- The inner areaoffset_x
- The offset from the maximum-x edgeoffset_y
- The offset from the minimum-y edge- Returns:
- An aligned area
-
alignMaxYMinX
Equivalent to callingalignMaxYMinXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignMaxYMinXOffset
public static AreaBI alignMaxYMinXOffset(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the maximum-y edge is at leastoffset_y
from the inside maximum-y edge ofouter
and the minimum-x edge is at leastoffset_x
from the inside minimum-x edge ofouter
.- Parameters:
outer
- The outer areainner
- The inner areaoffset_x
- The offset from the minimum-x edgeoffset_y
- The offset from the maximum-y edge- Returns:
- An aligned area
-
alignMaxYMaxX
Equivalent to callingalignMaxYMaxXOffset(AreaBI, AreaBI, java.math.BigInteger, java.math.BigInteger)
with zero offsets.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
alignMaxYMaxXOffset
public static AreaBI alignMaxYMaxXOffset(AreaBI outer, AreaBI inner, BigInteger offset_x, BigInteger offset_y) Align the areainner
such that the maximum-y edge is at leastoffset_y
from the inside maximum-y edge ofouter
and the maximum-x edge is at leastoffset_x
from the inside maximum-x edge ofouter
.- Parameters:
outer
- The outer areainner
- The inner areaoffset_x
- The offset from the maximum-x edgeoffset_y
- The offset from the maximum-y edge- Returns:
- An aligned area
-
alignCenter
Align the areainner
such that the center of the area is equal to the center ofouter
.- Parameters:
outer
- The outer areainner
- The inner area- Returns:
- An aligned area
-
hollowOut
public static AreaBI hollowOut(AreaBI outer, BigInteger min_x_offset, BigInteger max_x_offset, BigInteger min_y_offset, BigInteger max_y_offset) Construct a new area that fits insideouter
based on the given offsets from each edge.- Parameters:
outer
- The containing areamin_x_offset
- The offset from the minimum-x edge (must be non-negative)max_x_offset
- The offset from the maximum-x edge (must be non-negative)min_y_offset
- The offset from the minimum-y edge (must be non-negative)max_y_offset
- The offset from the maximum-y edge (must be non-negative)- Returns:
- A new area
-
hollowOutEvenly
Equivalent to callinghollowOut(AreaBI, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger, java.math.BigInteger)
withoffset
for all offset parameters.- Parameters:
outer
- The containing areaoffset
- The offset from each edge (must be non-negative)- Returns:
- A new area
-
setSizeFromCenter
Set the sizeX and sizeY of
area
tosizeX
andsizeY
, respectively.The area is resized from its own center.
- Parameters:
area
- The areasizeX
- The new sizeX (must be non-negative)sizeY
- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMinX
Set the sizeX and sizeY of
area
tosizeX
andsizeY
, respectively.The area is resized by moving its minimum-y-minimum-x corner.
- Parameters:
area
- The areasizeX
- The new sizeX (must be non-negative)sizeY
- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMinYMaxX
Set the sizeX and sizeY of
area
tosizeX
andsizeY
, respectively.The area is resized by moving its minimum-y-maximum-x corner.
- Parameters:
area
- The areasizeX
- The new sizeX (must be non-negative)sizeY
- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMaxX
Set the sizeX and sizeY of
area
tosizeX
andsizeY
, respectively.The area is resized by moving its maximum-y-maximum-x corner.
- Parameters:
area
- The areasizeX
- The new sizeX (must be non-negative)sizeY
- The new sizeY (must be non-negative)- Returns:
- A resized area
-
setSizeFromMaxYMinX
Set the sizeX and sizeY of
area
tosizeX
andsizeY
, respectively.The area is resized by moving its maximum-y-minimum-x corner.
- Parameters:
area
- The areasizeX
- The new sizeX (must be non-negative)sizeY
- The new sizeY (must be non-negative)- Returns:
- A resized area
-
scaleFromMinYMinX
Scale
area
by addingx_diff
to the sizeX, andy_diff
to the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its minimum-y-minimum-x corner.
- Parameters:
area
- The areax_diff
- The X differencey_diff
- The Y difference- Returns:
- A resized area
-
scaleFromMinYMaxX
Scale
area
by addingx_diff
to the sizeX, andy_diff
to the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its minimum-y-maximum-x corner.
- Parameters:
area
- The areax_diff
- The X differencey_diff
- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMinX
Scale
area
by addingx_diff
to the sizeX, andy_diff
to the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its maximum-y-minimum-x corner.
- Parameters:
area
- The areax_diff
- The X differencey_diff
- The Y difference- Returns:
- A resized area
-
scaleFromMaxYMaxX
Scale
area
by addingx_diff
to the sizeX, andy_diff
to the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized by moving its maximum-y-maximum-x corner.
- Parameters:
area
- The areax_diff
- The X differencey_diff
- The Y difference- Returns:
- A resized area
-
scaleFromCenter
Scale
area
by addingx_diff
to the sizeX, andy_diff
to the sizeY. The size of the resulting area is clamped so that its sizeX and sizeY are always non-negative.The area is resized from its own center.
- Parameters:
area
- The areax_diff
- The X differencey_diff
- The Y difference- Returns:
- A resized area
-
overlaps
Determine whether or not two areas overlap.
Overlapping is reflexive:
overlaps(a, a) == true
.Overlapping is symmetric:
overlaps(a, b) == overlaps(b, a)
.Overlapping is not necessarily transitive.
- Parameters:
a
- An areab
- An area- Returns:
true
iffa
overlapsb
-
couldFitInside
Determine whether or not one area could fit inside another.
Fitting is reflexive:
couldFitInside(a, a) == true
.Fitting is transitive:
couldFitInside(a, b) → couldFitInside(b, c) → couldFitInside(a, c)
.Fitting is not necessarily symmetric.
- Parameters:
a
- An areab
- An area- Returns:
true
iffa
could fit insideb
-
containing
Construct a area that will contain botha
andb
.- Parameters:
a
- An areab
- An area- Returns:
- An area containing
a
andb
-
containsPoint
Determine whether or not a area contains a given point.
- Parameters:
a
- An areax
- The X coordinate of the pointy
- The Y coordinate of the point- Returns:
true
iffa
contains(x, y)
-
fitBetweenHorizontal
Deprecated.Attempt to fitfit
betweena
andb
, horizontally.- Parameters:
fit
- The area to be fitteda
- An areab
- An area- Returns:
- A fitted area
-
fitBetweenVertical
Deprecated.Attempt to fitfit
betweena
andb
, vertically.- Parameters:
fit
- The area to be fitteda
- An areab
- An area- Returns:
- A fitted area
-
fitBetweenOnX
Attempt to fitfit
betweena
andb
, horizontally.- Parameters:
fit
- The area to be fitteda
- An areab
- An area- Returns:
- A fitted area
-
fitBetweenOnY
Attempt to fitfit
betweena
andb
, vertically.- Parameters:
fit
- The area to be fitteda
- An areab
- An area- Returns:
- A fitted area
-
splitAlongParallelToX
Splitarea
along a line parallel to the X axis placed aty
units from its own minimum-y edge.- Parameters:
area
- The area to be splity
- The relative Y coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongParallelToY
Splitarea
along a line parallel to the Y axis placed atx
units from its own minimum-x edge.- Parameters:
area
- The area to be splitx
- The relative X coordinate of the splitting edge- Returns:
- A pair of areas
-
splitAlongXY
Splitarea
along a two axis-aligned perpendicular lines that intercept at(x, y)
.- Parameters:
area
- The area to be splitx
- The relative X coordinate of the splitting edgey
- The relative Y coordinate of the splitting edge- Returns:
- The four resulting quadrants
- Since:
- 1.1.0
-
show
- Parameters:
area
- The area- Returns:
- A terse string describing the position and size of the area
-
size
- Parameters:
area
- The area- Returns:
- The size of the area
-
showToBuilder
- Parameters:
area
- The areasb
- A string builder- Returns:
- A terse string describing the position and size of the area
-
alignOnXCenter(AreaBI, AreaBI)