33 const double minSize,
const double maxSize,
42 item.minSize = minSize;
43 item.maxSize = maxSize;
60 double currentSize = 0;
66 for (
int i = 0; i < items.
size(); ++i)
69 currentSize +=
it.size;
71 if (
it.order <= order)
73 minSize +=
it.minSize;
74 maxSize +=
it.maxSize;
92 for (
int i = 0; i < items.
size(); ++i)
96 if (
it.order <= order)
106 for (
int i = 0; i < items.
size(); ++i)
110 if (
it.order <= order)
111 it.size =
jmax (
it.minSize,
it.minSize + (
it.size -
it.minSize) * scale);
int size() const noexcept
Returns the current number of elements in the array.
void add(const ElementType &newElement)
Appends a new element at the end of the array.
ElementType & getReference(int index) noexcept
Returns a direct reference to one of the elements in the array, without checking the index passed in.
void addItem(double currentSize, double minSize, double maxSize, int order=0)
Adds an item to the list.
double getItemSize(int index) const noexcept
Returns the size of one of the items.
~StretchableObjectResizer()
Destructor.
void resizeToFit(double targetSize)
Resizes all the items to fit this amount of space.
StretchableObjectResizer()
Creates an empty object resizer.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
constexpr Type jmax(Type a, Type b)
Returns the larger of two values.
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Constrains a value to keep it within a given range.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
bool isPositiveAndBelow(Type1 valueToTest, Type2 upperLimit) noexcept
Returns true if a value is at least zero, and also below a specified upper limit.