Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Mar 1998 21:51:49 -0800 (PST)
From:      giffunip@asme.org
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   ports/5935: Fix to femlab (math) port
Message-ID:  <199803070551.VAA28691@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         5935
>Category:       ports
>Synopsis:       Fix to femlab (math) port
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar  6 22:00:01 PST 1998
>Last-Modified:
>Originator:     Pedro Giffuni
>Organization:
U. Nacional de Colombia
>Release:        2.2.5-R
>Environment:
>Description:
When zooming a solution in femlab you could block your Xserver due to
an infinite loop. This was really the result of avoiding the 
mathematical exception resulting when double clicking.
>How-To-Repeat:
This patch avoids the numerical exception by avoiding the redraw if the
math is unsuitable. The end result is better than the traditional
masking. There's also a minor build fix.
>Fix:
diff -ru /cdrom/ports/math/femlab/patches/patch-aa femlab/patches/patch-aa
--- /cdrom/ports/math/femlab/patches/patch-aa	Tue Sep 16 02:05:00 1997
+++ femlab/patches/patch-aa	Fri Mar  6 22:06:37 1998
@@ -1,5 +1,5 @@
-*** source/Imakefile.orig	Tue Sep  2 10:38:18 1997
---- source/Imakefile	Tue Sep  2 10:39:42 1997
+*** source/Imakefile.orig	Tue Sep 19 02:22:29 1995
+--- source/Imakefile	Fri Mar  6 22:03:52 1998
 ***************
 *** 17,29 ****
   
@@ -19,7 +19,7 @@
   
               OBJS = $(SRCS:.c=.o)
   
-!               CC = gcc -O2
+!               CC = gcc -O $(CFLAGS)
        CDEBUGFLAGS = 
     EXTRA_INCLUDES = -I../include
   #
diff -ru /cdrom/ports/math/femlab/patches/patch-ab femlab/patches/patch-ab
--- /cdrom/ports/math/femlab/patches/patch-ab	Tue Sep 16 02:05:00 1997
+++ femlab/patches/patch-ab	Sat Mar  7 00:15:33 1998
@@ -1,5 +1,19 @@
-*** source/graph.c.orig	Sat Sep 13 16:23:18 1997
---- source/graph.c	Sat Sep 13 16:39:13 1997
+*** source/graph.c.orig	Thu Sep 14 08:42:13 1995
+--- source/graph.c	Sat Mar  7 00:14:42 1998
+***************
+*** 14,21 ****
+--- 14,24 ----
+   */
+  
+  #include <stdio.h>
++ #ifdef __STDC__
+  #include <stdlib.h>
++ #else
+  #include <malloc.h>
++ #endif
+  #include <math.h>
+  
+  
 ***************
 *** 608,614 ****
   void getDrawingScale()
@@ -9,7 +23,7 @@
     int width, height;
     int ww;
     int nx, ny, id;
---- 608,614 ----
+--- 611,617 ----
   void getDrawingScale()
   {
     float xoff, yoff;
@@ -18,7 +32,7 @@
     int ww;
     int nx, ny, id;
 ***************
-*** 630,645 ****
+*** 630,654 ****
     width = width / nx;
     height = height / ny;
   
@@ -26,30 +40,49 @@
 !     scl  = 1./max(xmax-xmin,ymax-ymin);
 !     xoff = -scl*(xmin+.5*(xmax-xmin)-.5/scl);
 !     yoff = -scl*(ymin+.5*(ymax-ymin)-.5/scl);
-  
+! 
 !     xoff =  - xmin*scl*.85;
 !     yoff =  - ymin*scl*.85;
-  
-      ww = min(width, height);
+! 
+!     ww = min(width, height);
 !     Xscl  = (int) ((float)ww * 0.85 * scl);
-      Xxoff = (int) ww * xoff ;
-      Xyoff = (int) ww * yoff;
-      Xxoff += (int) (width -  ( Xscl*xmax +Xxoff))/2 + (id+nx-1)%nx *width;
---- 630,646 ----
+!     Xxoff = (int) ww * xoff ;
+!     Xyoff = (int) ww * yoff;
+!     Xxoff += (int) (width -  ( Xscl*xmax +Xxoff))/2 + (id+nx-1)%nx *width;
+!     Xyoff += (int) (height - ( Xscl*ymax +Xyoff))/2 + (int)(id/(nx+.5)) *height;
+!   }
+  
+    SetDrawArea(drawWindow);
+    if(device == PS)
+      psGetScale();
+  }
+  
+  void getBoundaryScale(Widget w, void *data)
+--- 633,659 ----
     width = width / nx;
     height = height / ny;
   
 !   iscl  = max(xmax-xmin,ymax-ymin);
-  
-!   if((state > HAVE_NOTHING) && (iscl != 0.0)){
+!   if (iscl != 0.0) {
+!    if(state > HAVE_NOTHING) {
+! /*  These are recalculated ??
 !     xoff = .5-(xmin+.5*(xmax-xmin))/iscl;
 !     yoff = .5-(ymin+.5*(ymax-ymin))/iscl;
-! 
-!     xoff =  - xmin*.85/iscl;
-!     yoff =  - ymin*.85/iscl;
+! */
+!       xoff =  - xmin*.85/iscl;
+!       yoff =  - ymin*.85/iscl;
+!       ww = min(width, height);
+!       Xscl  = (int) ((float)ww * 0.85 / iscl);
+!       Xxoff = (int) ww * xoff ;
+!       Xyoff = (int) ww * yoff;
+!       Xxoff += (int) (width -  ( Xscl*xmax +Xxoff))/2 + (id+nx-1)%nx *width;
+!       Xyoff += (int) (height - ( Xscl*ymax +Xyoff))/2 + (int)(id/(nx+.5)) *height;
+!    }
+  
+    SetDrawArea(drawWindow);
+    if(device == PS)
+      psGetScale();
++   }
+  }
   
-      ww = min(width, height);
-!     Xscl  = (int) ((float)ww * 0.85 / iscl);
-      Xxoff = (int) ww * xoff ;
-      Xyoff = (int) ww * yoff;
-      Xxoff += (int) (width -  ( Xscl*xmax +Xxoff))/2 + (id+nx-1)%nx *width;
+  void getBoundaryScale(Widget w, void *data)

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803070551.VAA28691>