From cc6af6b78020be05cf853f7d7aecb04bbd551626 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 18 Jul 2007 22:10:00 +0200 Subject: fix paper size handling --- NEWS | 1 + src/GsWidget.H | 2 ++ src/GsWidget.cxx | 16 +++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 7df6abe..83452ba 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ flpsed ChangeLog - fix long standing redraw problem. - fix PostScript DSC problem (reported by Jim Cline). - ask before overwriting files. + - fix problem with non-A4 paper sizes. flpsed-0.3.9 - fix problem with documents that embed standard font replacements 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); +} -- cgit v1.2.3