From 9583092a2166fe6899c616dd2f52b73dba8d34bc Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 10 Nov 2004 17:49:08 +0000 Subject: get rid of those stupid floating point computations. get rid of those stupid floating point computations. --- src/GsWidget.H | 4 ++-- src/GsWidget.cxx | 8 ++++---- src/PSEditWidget.cxx | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/GsWidget.H b/src/GsWidget.H index e572cc2..8760213 100644 --- a/src/GsWidget.H +++ b/src/GsWidget.H @@ -1,5 +1,5 @@ // -// "$Id: GsWidget.H,v 1.2 2004/10/12 16:41:43 hofmann Exp $" +// "$Id: GsWidget.H,v 1.3 2004/11/10 18:49:08 hofmann Exp $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -45,7 +45,7 @@ class GsWidget : public Fl_Widget { protected: int page; Fl_Offscreen offscreen; - float xdpi, ydpi; + int xdpi, ydpi; int paper_x, paper_y; void draw(); diff --git a/src/GsWidget.cxx b/src/GsWidget.cxx index e2c3341..7ecbedd 100644 --- a/src/GsWidget.cxx +++ b/src/GsWidget.cxx @@ -1,5 +1,5 @@ // -// "$Id: GsWidget.cxx,v 1.11 2004/10/26 18:08:57 hofmann Exp $" +// "$Id: GsWidget.cxx,v 1.12 2004/11/10 18:49:08 hofmann Exp $" // // GsWidget routines. // @@ -66,7 +66,7 @@ void GsWidget::setProps() { atoms[3] = XInternAtom(fl_display,"PAGE" , false); atoms[4] = XInternAtom(fl_display,"DONE" , false); - snprintf(data, 512, "%lu %d %d %d %d %d %g %g", + snprintf(data, 512, "%lu %d %d %d %d %d %d.0 %d.0", 0, 0, 0, 0, paper_x, paper_y, xdpi, ydpi); int xid = fl_xid(window()); @@ -100,8 +100,8 @@ GsWidget::GsWidget(int X,int Y,int W, int H) : Fl_Widget(X, Y, W, H) { offscreen = 0; gs_pid = 0; page = 0; - xdpi = 75.0; - ydpi = 75.0; + xdpi = 75; + ydpi = 75; paper_x = 594; // DIN A4 paper_y = 841; // in_fd = -1; diff --git a/src/PSEditWidget.cxx b/src/PSEditWidget.cxx index 034be00..572f010 100644 --- a/src/PSEditWidget.cxx +++ b/src/PSEditWidget.cxx @@ -1,5 +1,5 @@ // -// "$Id: PSEditWidget.cxx,v 1.29 2004/11/10 18:32:59 hofmann Exp $" +// "$Id: PSEditWidget.cxx,v 1.30 2004/11/10 18:49:08 hofmann Exp $" // // PSEditWidget routines. // @@ -339,17 +339,17 @@ int PSEditWidget::bb_h(PSEditText *t) { int PSEditWidget::ps_to_display_x(int x1) { - return (int) ((float) x1 * xdpi / 72.0); + return (x1 * xdpi) / 72; } int PSEditWidget::ps_to_display_y(int y1) { - return (int) ((float) (paper_y - y1) * xdpi / 72.0); + return ((paper_y - y1) * xdpi) / 72; } int PSEditWidget::ps_x(int x1) { - return (int) ((float) x1 * 72.0 / xdpi); + return (x1 * 72) / xdpi; } int PSEditWidget::ps_y(int y1) { - return paper_y - (int)((float) y1 * 72.0 / ydpi); + return paper_y - (y1 * 72) / ydpi; } -- cgit v1.2.3