diff options
author | David Robillard <d@drobilla.net> | 2019-07-26 00:57:49 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-26 01:05:37 +0200 |
commit | eada1042452e8708ca6c65f7c23ac3c59e4c53f0 (patch) | |
tree | 2155469130ef05d42f49a02c0af3abedf66fe9f1 /test/pugl_test.c | |
parent | 55199fe97d7866a0c8998455e43bb5b1f2989eb7 (diff) | |
download | pugl-eada1042452e8708ca6c65f7c23ac3c59e4c53f0.tar.gz pugl-eada1042452e8708ca6c65f7c23ac3c59e4c53f0.tar.bz2 pugl-eada1042452e8708ca6c65f7c23ac3c59e4c53f0.zip |
Windows: Implement size constraints
There are two possible approaches to take here: try to expand dimensions that
are not being explicitly resized (for example expand the bottom when dragging
right), or just stop single-dimension resizes if they would go out of range.
I chose the latter here for two reasons: it's hard to always do something
smooth and unsurprising with the first approach (and it would require more
code), and it can be nice from the user's perspective to easily be able to
resize the window to exactly one of its aspect ratio limits. For example, it
is very easy to drag pugl_test to 1:1 or 16:9.
In other words, simplicity and user power wins.
Diffstat (limited to 'test/pugl_test.c')
-rw-r--r-- | test/pugl_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/pugl_test.c b/test/pugl_test.c index a609027..f011962 100644 --- a/test/pugl_test.c +++ b/test/pugl_test.c @@ -170,7 +170,7 @@ main(int argc, char** argv) puglInitWindowClass(view, "PuglTest"); puglInitWindowSize(view, 512, 512); puglInitWindowMinSize(view, 256, 256); - puglInitWindowAspectRatio(view, 1, 1, 1, 1); + puglInitWindowAspectRatio(view, 1, 1, 16, 9); puglInitResizable(view, resizable); puglInitWindowHint(view, PUGL_SAMPLES, samples); |