aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac.m
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-01-22 18:42:13 -0500
committerDavid Robillard <d@drobilla.net>2025-01-22 18:42:13 -0500
commit44e65f78fca1597471d31a96907d5be465ca1ec1 (patch)
tree8c6394d767a0166fc7f69166b278f20a94dad454 /src/mac.m
parent8905c1176aa5099545fd9abb2e673efc136d0311 (diff)
downloadpugl-44e65f78fca1597471d31a96907d5be465ca1ec1.tar.gz
pugl-44e65f78fca1597471d31a96907d5be465ca1ec1.tar.bz2
pugl-44e65f78fca1597471d31a96907d5be465ca1ec1.zip
Factor out puglIsValidPosition()
Diffstat (limited to 'src/mac.m')
-rw-r--r--src/mac.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mac.m b/src/mac.m
index 368b137..180db83 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -1167,7 +1167,7 @@ getInitialFrame(PuglView* const view)
const int x = view->defaultX;
const int y = view->defaultY;
- if (x >= INT16_MIN && x <= INT16_MAX && y >= INT16_MIN && y <= INT16_MAX) {
+ if (puglIsValidPosition(x, y)) {
// Use the default position set with puglSetPosition while unrealized
const PuglRect frame = {(PuglCoord)x,
(PuglCoord)y,
@@ -1773,7 +1773,7 @@ puglSetFrame(PuglView* view, const PuglRect frame)
PuglStatus
puglSetPosition(PuglView* const view, const int x, const int y)
{
- if (x < INT16_MIN || x > INT16_MAX || y < INT16_MIN || y > INT16_MAX) {
+ if (!puglIsValidPosition(x, y)) {
return PUGL_BAD_PARAMETER;
}