1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00
freebsd-ports/math/femlab/files/patch-ab
Thomas Gellekum 2b4ca0d2c4 Import of femlab port. femlab solves PDEs in 2D using the
finite element method.

PR:		4531
Submitted by:	Pedro Giffuni <giffunip@asme.org>
1997-09-16 07:05:00 +00:00

56 lines
1.4 KiB
Plaintext

*** source/graph.c.orig Sat Sep 13 16:23:18 1997
--- source/graph.c Sat Sep 13 16:39:13 1997
***************
*** 608,614 ****
void getDrawingScale()
{
float xoff, yoff;
! float scl;
int width, height;
int ww;
int nx, ny, id;
--- 608,614 ----
void getDrawingScale()
{
float xoff, yoff;
! float iscl; /* inverse scale */
int width, height;
int ww;
int nx, ny, id;
***************
*** 630,645 ****
width = width / nx;
height = height / ny;
! if(state > HAVE_NOTHING){
! 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);
! 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 ----
width = width / nx;
height = height / ny;
! iscl = max(xmax-xmin,ymax-ymin);
! if((state > HAVE_NOTHING) && (iscl != 0.0)){
! xoff = .5-(xmin+.5*(xmax-xmin))/iscl;
! yoff = .5-(ymin+.5*(ymax-ymin))/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;