diff options
author | David Robillard <d@drobilla.net> | 2025-02-08 20:41:41 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-08 20:41:41 -0500 |
commit | d0f0238bef9684ce71b68debf32b2d068e19bda5 (patch) | |
tree | 58f916bfd578840955124c0aefb8acb4e5fcba58 | |
parent | 45d36b04b8998af3e939b24d3e6a9cd7e504800b (diff) | |
download | pugl-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.c | 3 |
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 |