aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-02-08 20:41:41 -0500
committerDavid Robillard <d@drobilla.net>2025-02-08 20:41:41 -0500
commitd0f0238bef9684ce71b68debf32b2d068e19bda5 (patch)
tree58f916bfd578840955124c0aefb8acb4e5fcba58
parent45d36b04b8998af3e939b24d3e6a9cd7e504800b (diff)
downloadpugl-d0f0238bef9684ce71b68debf32b2d068e19bda5.tar.gz
pugl-d0f0238bef9684ce71b68debf32b2d068e19bda5.tar.bz2
pugl-d0f0238bef9684ce71b68debf32b2d068e19bda5.zip
Fix puglIsvalidPosition()
Most obivously, this made top-level views initially invisible on Windows because they were placed at (-32768, -32768).
-rw-r--r--src/internal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/internal.c b/src/internal.c
index 00867e8..ca84ed1 100644
--- a/src/internal.c
+++ b/src/internal.c
@@ -23,7 +23,8 @@ make_point(const PuglCoord x, const PuglCoord y)
bool
puglIsValidPosition(const int x, const int y)
{
- return x >= INT16_MIN && x < INT16_MAX && y >= INT16_MIN && y < INT16_MAX;
+ // INT16_MIN is a sentinel, INT16_MAX is impossible with non-zero size
+ return x > INT16_MIN && x < INT16_MAX && y > INT16_MIN && y < INT16_MAX;
}
bool