From 44e65f78fca1597471d31a96907d5be465ca1ec1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 22 Jan 2025 18:42:13 -0500 Subject: Factor out puglIsValidPosition() --- src/mac.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mac.m') 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; } -- cgit v1.2.1