summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-01-18 16:12:11 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-01-18 16:12:11 +0100
commit7c3b29bde40fa215f35de1197c1ef0fc51f9c113 (patch)
tree5d52a70487864b832a30fa522f36ae6e0ae687e3 /src
parentf3eae27dcd8f5a1ec9a18a66ee7c40a8b3446a12 (diff)
don't make view window larger than screen
Diffstat (limited to 'src')
-rw-r--r--src/gipfel.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index bc6b050..5a4eecf 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -9,6 +9,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
+#include <algorithm>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
@@ -415,7 +416,7 @@ create_control_window() {
int main(int argc, char** argv) {
char c, **my_argv;
char *view_point = NULL;
- int err, my_argc;
+ int err, my_argc, sx, sy, sw, sh;
int stitch_flag = 0, stitch_w = 2000, stitch_h = 500;
int jpeg_flag = 0, tiff_flag = 0, distortion_flag = 0, position_flag = 0;
int export_flag = 0;
@@ -564,8 +565,9 @@ int main(int argc, char** argv) {
gipf->set_distortion_params(dist_k0, dist_k1, dist_x0);
}
- view_win->size(gipf->w(), gipf->h());
- scroll->size(gipf->w(), gipf->h());
+ Fl::screen_xywh(sx, sy, sw, sh);
+ view_win->size(std::min(gipf->w(), sw), std::min(gipf->h(), sh));
+ scroll->size(view_win->w(), view_win->h());
gipf->load_data(data_file);
gipf->set_height_dist_ratio(visibility);