summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-07-18 22:10:00 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-07-18 22:10:00 +0200
commitcc6af6b78020be05cf853f7d7aecb04bbd551626 (patch)
treebc29723fec60519eceeb73d0eb6e52cc1a4e74b4 /src
parentd6368f0947809b227e45a592f038d8629dca2794 (diff)
fix paper size handling
Diffstat (limited to 'src')
-rw-r--r--src/GsWidget.H2
-rw-r--r--src/GsWidget.cxx16
2 files changed, 13 insertions, 5 deletions
diff --git a/src/GsWidget.H b/src/GsWidget.H
index 95a3242..a5d0fd1 100644
--- a/src/GsWidget.H
+++ b/src/GsWidget.H
@@ -30,6 +30,8 @@ class GsWidget : public Fl_Widget {
int zoom_percent;
int initial_width, initial_height;
int feeding;
+
+ void resize();
protected:
int page;
diff --git a/src/GsWidget.cxx b/src/GsWidget.cxx
index 71537e9..ad516b7 100644
--- a/src/GsWidget.cxx
+++ b/src/GsWidget.cxx
@@ -93,8 +93,7 @@ GsWidget::GsWidget(int X,int Y,int W, int H) : Fl_Widget(X, Y, W, H) {
ydpi = 75 * zoom_percent / 100;
paper_x = 594; // DIN A4
paper_y = 841; //
- initial_width = W;
- initial_height = H;
+ resize();
in_fd = -1;
reload_needed = 0;
dsc = NULL;
@@ -141,6 +140,8 @@ int GsWidget::open_file(int fd) {
paper_y = 841; //
}
+ resize();
+
page = 0;
return 0;
@@ -396,11 +397,11 @@ int GsWidget::zoom(int p) {
offscreen = 0;
}
- w(initial_width * zoom_percent / 100);
- h(initial_height * zoom_percent / 100);
-
xdpi = 75 * zoom_percent / 100;
ydpi = 75 * zoom_percent / 100;
+
+ resize();
+
reload();
return 0;
@@ -414,3 +415,8 @@ GsWidget::get_pages() {
return 0;
}
}
+
+void
+GsWidget::resize() {
+ size(paper_x * xdpi / 72, paper_y * ydpi / 72);
+}