42 jassert (minimumWidth > 0 && minimumHeight > 0);
55 jassert (maximumWidth > 0 && maximumHeight > 0);
64 int maximumHeight)
noexcept
66 jassert (maximumWidth >= minimumWidth);
67 jassert (maximumHeight >= minimumHeight);
68 jassert (maximumWidth > 0 && maximumHeight > 0);
69 jassert (minimumWidth > 0 && minimumHeight > 0);
78 int minimumWhenOffTheLeft,
79 int minimumWhenOffTheBottom,
80 int minimumWhenOffTheRight)
noexcept
100 bool isStretchingTop,
101 bool isStretchingLeft,
102 bool isStretchingBottom,
103 bool isStretchingRight)
105 jassert (component !=
nullptr);
107 auto bounds = targetBounds;
116 if (
auto* display =
Desktop::getInstance().getDisplays().getDisplayForPoint (globalBounds.getCentre()))
119 const auto max = std::numeric_limits<int>::max();
126 if (
auto* peer = component->
getPeer())
127 if (
const auto frameSize = peer->getFrameSizeIfPresent())
137 isStretchingTop, isStretchingLeft,
138 isStretchingBottom, isStretchingRight);
140 border.subtractFrom (bounds);
148 false,
false,
false,
false);
154 positioner->applyNewBounds (bounds);
172 bool isStretchingTop,
173 bool isStretchingLeft,
174 bool isStretchingBottom,
175 bool isStretchingRight)
177 if (isStretchingLeft)
209 if (isStretchingLeft)
222 if (isStretchingBottom)
235 if (isStretchingRight)
247 if ((isStretchingTop || isStretchingBottom) && ! (isStretchingLeft || isStretchingRight))
251 else if ((isStretchingLeft || isStretchingRight) && ! (isStretchingTop || isStretchingBottom))
258 const double newRatio = std::abs (bounds.
getWidth() / (
double) bounds.
getHeight());
260 adjustWidth = (oldRatio > newRatio);
284 if ((isStretchingTop || isStretchingBottom) && ! (isStretchingLeft || isStretchingRight))
288 else if ((isStretchingLeft || isStretchingRight) && ! (isStretchingTop || isStretchingBottom))
294 if (isStretchingLeft)
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
#define noexcept
Definition DistrhoDefines.h:72
T limit(T val, T min, T max)
Definition Util.h:78
Definition juce_BorderSize.h:42
double getFixedAspectRatio() const noexcept
Definition juce_ComponentBoundsConstrainer.cpp:93
void setMaximumHeight(int maximumHeight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:36
double aspectRatio
Definition juce_ComponentBoundsConstrainer.h:192
void setMinimumSize(int minimumWidth, int minimumHeight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:38
void setFixedAspectRatio(double widthOverHeight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:88
int maxH
Definition juce_ComponentBoundsConstrainer.h:190
int minOffTop
Definition juce_ComponentBoundsConstrainer.h:191
void setMinimumOnscreenAmounts(int minimumWhenOffTheTop, int minimumWhenOffTheLeft, int minimumWhenOffTheBottom, int minimumWhenOffTheRight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:77
void setBoundsForComponent(Component *component, Rectangle< int > bounds, bool isStretchingTop, bool isStretchingLeft, bool isStretchingBottom, bool isStretchingRight)
Definition juce_ComponentBoundsConstrainer.cpp:98
void setMinimumWidth(int minimumWidth) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:33
int minW
Definition juce_ComponentBoundsConstrainer.h:190
void setMaximumSize(int maximumWidth, int maximumHeight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:51
void setMinimumHeight(int minimumHeight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:35
virtual void resizeEnd()
Definition juce_ComponentBoundsConstrainer.cpp:164
virtual void applyBoundsToComponent(Component &, Rectangle< int > bounds)
Definition juce_ComponentBoundsConstrainer.cpp:151
int maxW
Definition juce_ComponentBoundsConstrainer.h:190
void setMaximumWidth(int maximumWidth) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:34
virtual ~ComponentBoundsConstrainer()
Definition juce_ComponentBoundsConstrainer.cpp:30
int minOffBottom
Definition juce_ComponentBoundsConstrainer.h:191
int minOffRight
Definition juce_ComponentBoundsConstrainer.h:191
ComponentBoundsConstrainer() noexcept
Definition juce_ComponentBoundsConstrainer.cpp:29
void setSizeLimits(int minimumWidth, int minimumHeight, int maximumWidth, int maximumHeight) noexcept
Definition juce_ComponentBoundsConstrainer.cpp:61
int minOffLeft
Definition juce_ComponentBoundsConstrainer.h:191
virtual void resizeStart()
Definition juce_ComponentBoundsConstrainer.cpp:160
void checkComponentBounds(Component *component)
Definition juce_ComponentBoundsConstrainer.cpp:145
int minH
Definition juce_ComponentBoundsConstrainer.h:190
virtual void checkBounds(Rectangle< int > &bounds, const Rectangle< int > &previousBounds, const Rectangle< int > &limits, bool isStretchingTop, bool isStretchingLeft, bool isStretchingBottom, bool isStretchingRight)
Definition juce_ComponentBoundsConstrainer.cpp:169
Definition juce_Component.h:36
Component * getParentComponent() const noexcept
Definition juce_Component.h:804
Point< int > getPosition() const noexcept
Definition juce_Component.h:286
Rectangle< int > getLocalArea(const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
Definition juce_Component.cpp:1138
Positioner * getPositioner() const noexcept
Definition juce_Component.cpp:2270
Rectangle< int > getBounds() const noexcept
Definition juce_Component.h:304
Rectangle< int > localAreaToGlobal(Rectangle< int > localArea) const
Definition juce_Component.cpp:1143
void setBounds(int x, int y, int width, int height)
Definition juce_Component.cpp:1147
ComponentPeer * getPeer() const
Definition juce_Component.cpp:801
static Desktop &JUCE_CALLTYPE getInstance()
Definition juce_Desktop.cpp:50
Definition juce_Rectangle.h:67
ValueType getRight() const noexcept
Definition juce_Rectangle.h:139
void setLeft(ValueType newLeft) noexcept
Definition juce_Rectangle.h:261
void setHeight(ValueType newHeight) noexcept
Definition juce_Rectangle.h:204
ValueType getHeight() const noexcept
Definition juce_Rectangle.h:136
void setRight(ValueType newRight) noexcept
Definition juce_Rectangle.h:285
void setBottom(ValueType newBottom) noexcept
Definition juce_Rectangle.h:297
void setWidth(ValueType newWidth) noexcept
Definition juce_Rectangle.h:201
ValueType getBottom() const noexcept
Definition juce_Rectangle.h:142
void setTop(ValueType newTop) noexcept
Definition juce_Rectangle.h:273
ValueType getX() const noexcept
Definition juce_Rectangle.h:127
ValueType getWidth() const noexcept
Definition juce_Rectangle.h:133
void setX(ValueType newX) noexcept
Definition juce_Rectangle.h:195
void setY(ValueType newY) noexcept
Definition juce_Rectangle.h:198
bool isEmpty() const noexcept
Definition juce_Rectangle.h:121
ValueType getY() const noexcept
Definition juce_Rectangle.h:130
static ZCONST unsigned border[]
Definition inflate.c:749
static uintptr_t parent
Definition pugl.h:1644
Definition carla_juce.cpp:31
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Definition juce_MathsFunctions.h:262
int roundToInt(const FloatType value) noexcept
Definition juce_MathsFunctions.h:465
#define max(x, y)
Definition os.h:78
#define const
Definition zconf.h:137