aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.c
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/common.c
parent8905c1176aa5099545fd9abb2e673efc136d0311 (diff)
downloadpugl-44e65f78fca1597471d31a96907d5be465ca1ec1.tar.gz
pugl-44e65f78fca1597471d31a96907d5be465ca1ec1.tar.bz2
pugl-44e65f78fca1597471d31a96907d5be465ca1ec1.zip
Factor out puglIsValidPosition()
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index 8c2268b..2e6e0e6 100644
--- a/src/common.c
+++ b/src/common.c
@@ -12,7 +12,6 @@
#include <limits.h>
#include <stdbool.h>
-#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -302,7 +301,7 @@ puglGetFrame(const PuglView* view)
// Get the default position if set, or fallback to (0, 0)
int x = view->defaultX;
int y = view->defaultY;
- if (x < INT16_MIN || x > INT16_MAX || y < INT16_MIN || y > INT16_MAX) {
+ if (!puglIsValidPosition(x, y)) {
x = 0;
y = 0;
}