Go to the documentation of this file.
25 #ifndef JUCE_JUSTIFICATION_H_INCLUDED
26 #define JUCE_JUSTIFICATION_H_INCLUDED
65 inline bool testFlags (
int flagsToTest)
const noexcept {
return (flags & flagsToTest) != 0; }
79 template <
typename ValueType>
81 ValueType spaceX, ValueType spaceY, ValueType spaceW, ValueType spaceH)
const noexcept
85 else if ((flags &
right) != 0) x += spaceW - w;
89 else if ((flags &
bottom) != 0) y += spaceH - h;
94 template <
typename ValueType>
98 ValueType x = areaToAdjust.getX(), y = areaToAdjust.getY();
100 targetSpace.getX(), targetSpace.getY(), targetSpace.getWidth(), targetSpace.getHeight());
101 return areaToAdjust.withPosition (x, y);
189 #endif // JUCE_JUSTIFICATION_H_INCLUDED
void applyToRectangle(ValueType &x, ValueType &y, ValueType w, ValueType h, ValueType spaceX, ValueType spaceY, ValueType spaceW, ValueType spaceH) const noexcept
Definition: juce_Justification.h:80
@ topLeft
Definition: juce_Justification.h:165
const Rectangle< ValueType > appliedToRectangle(const Rectangle< ValueType > &areaToAdjust, const Rectangle< ValueType > &targetSpace) const noexcept
Definition: juce_Justification.h:95
@ centredRight
Definition: juce_Justification.h:150
@ centredLeft
Definition: juce_Justification.h:145
@ left
Definition: juce_Justification.h:110
Justification & operator=(const Justification &other) noexcept
Definition: juce_Justification.h:49
@ verticallyCentred
Definition: juce_Justification.h:128
Definition: juce_Rectangle.h:36
@ topRight
Definition: juce_Justification.h:170
@ bottomRight
Definition: juce_Justification.h:180
@ horizontallyCentred
Definition: juce_Justification.h:117
#define noexcept
Definition: juce_CompilerSupport.h:141
@ top
Definition: juce_Justification.h:121
int getOnlyVerticalFlags() const noexcept
Definition: juce_Justification.h:68
bool testFlags(int flagsToTest) const noexcept
Definition: juce_Justification.h:65
@ centred
Definition: juce_Justification.h:140
Flags
Definition: juce_Justification.h:106
@ right
Definition: juce_Justification.h:113
@ centredTop
Definition: juce_Justification.h:155
@ bottomLeft
Definition: juce_Justification.h:175
Justification(const Justification &other) noexcept
Definition: juce_Justification.h:46
@ horizontallyJustified
Definition: juce_Justification.h:134
@ bottom
Definition: juce_Justification.h:124
bool operator==(const Justification &other) const noexcept
Definition: juce_Justification.h:55
int getFlags() const noexcept
Definition: juce_Justification.h:60
int getOnlyHorizontalFlags() const noexcept
Definition: juce_Justification.h:71
@ centredBottom
Definition: juce_Justification.h:160
Definition: juce_Justification.h:38
Justification(int justificationFlags) noexcept
Definition: juce_Justification.h:43
bool operator!=(const Justification &other) const noexcept
Definition: juce_Justification.h:56