31 return flags == other.flags;
36 return flags != other.flags;
40 const double dx,
const double dy,
const double dw,
const double dh)
const noexcept
42 if (
w == 0.0 ||
h == 0.0)
58 scale =
jmin (scale, 1.0);
61 scale =
jmax (scale, 1.0);
71 x = dx + (dw -
w) * 0.5;
78 y =
dy + (dh -
h) * 0.5;
87 float newX = destination.getX();
88 float newY = destination.getY();
90 float scaleX = destination.getWidth() / source.getWidth();
91 float scaleY = destination.getHeight() / source.getHeight();
96 :
jmin (scaleX, scaleY);
99 scaleX =
jmin (scaleX, 1.0f);
102 scaleX =
jmax (scaleX, 1.0f);
107 newX += destination.getWidth() - source.getWidth() * scaleX;
109 newX += (destination.getWidth() - source.getWidth() * scaleX) / 2.0f;
112 newY += destination.getHeight() - source.getHeight() * scaleX;
114 newY += (destination.getHeight() - source.getHeight() * scaleX) / 2.0f;
118 .scaled (scaleX, scaleY)
119 .translated (newX, newY);
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
Type jmax(const Type a, const Type b)
Definition MathsFunctions.h:48
Definition juce_Rectangle.h:67
AffineTransform getTransformToFit(const Rectangle< float > &source, const Rectangle< float > &destination) const noexcept
Definition juce_RectanglePlacement.cpp:82
void applyTo(double &sourceX, double &sourceY, double &sourceW, double &sourceH, double destinationX, double destinationY, double destinationW, double destinationH) const noexcept
Definition juce_RectanglePlacement.cpp:39
RectanglePlacement(int placementFlags) noexcept
Definition juce_RectanglePlacement.h:44
@ onlyReduceInSize
Definition juce_RectanglePlacement.h:106
@ fillDestination
Definition juce_RectanglePlacement.h:101
@ onlyIncreaseInSize
Definition juce_RectanglePlacement.h:111
@ yTop
Definition juce_RectanglePlacement.h:76
@ xRight
Definition juce_RectanglePlacement.h:67
@ stretchToFit
Definition juce_RectanglePlacement.h:90
@ yBottom
Definition juce_RectanglePlacement.h:80
@ xLeft
Definition juce_RectanglePlacement.h:64
int flags
Definition juce_RectanglePlacement.h:171
UINT_D64 w
Definition inflate.c:942
int y
Definition inflate.c:1588
unsigned x[BMAX+1]
Definition inflate.c:1586
Definition carla_juce.cpp:31
constexpr Type jmax(Type a, Type b)
Definition juce_MathsFunctions.h:94
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
dy
Definition zipinfo.c:2288