31 template <
typename Po
intOrRect>
32 static PointOrRect unscaledScreenPosToScaled (
float scale, PointOrRect pos)
noexcept
37 template <
typename Po
intOrRect>
38 static PointOrRect scaledScreenPosToUnscaled (
float scale, PointOrRect pos)
noexcept
50 roundToInt ((
float) pos.getHeight() / scale)) : pos;
58 roundToInt ((
float) pos.getHeight() * scale)) : pos;
65 pos.getWidth() / scale,
66 pos.getHeight() / scale) : pos;
73 pos.getWidth() * scale,
74 pos.getHeight() * scale) : pos;
77 template <
typename Po
intOrRect>
78 static PointOrRect unscaledScreenPosToScaled (PointOrRect pos)
noexcept
83 template <
typename Po
intOrRect>
84 static PointOrRect scaledScreenPosToUnscaled (PointOrRect pos)
noexcept
89 template <
typename Po
intOrRect>
90 static PointOrRect unscaledScreenPosToScaled (
const Component& comp, PointOrRect pos)
noexcept
95 template <
typename Po
intOrRect>
96 static PointOrRect scaledScreenPosToUnscaled (
const Component& comp, PointOrRect pos)
noexcept
112 if (
auto* peer = comp.
getPeer())
114 pos = peer->globalToLocal (pos);
115 auto& peerComp = peer->getComponent();
116 return comp.
getLocalPoint (&peerComp, unscaledScreenPosToScaled (peerComp, pos));
119 return comp.
getLocalPoint (
nullptr, unscaledScreenPosToScaled (comp, pos));
constexpr bool approximatelyEqual(Type a, Type b, Tolerance< Type > tolerance=Tolerance< Type >{} .withAbsolute(std::numeric_limits< Type >::min()) .withRelative(std::numeric_limits< Type >::epsilon()))
Returns true if the two floating-point numbers are approximately equal.