summaryrefslogtreecommitdiff
path: root/graphics/ploticus/patches/patch-bc
blob: 5bda8aed9708f22a4a9b2c3af026647e9381fce4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$NetBSD: patch-bc,v 1.1 2005/05/02 17:58:00 drochner Exp $

--- autorange.c.orig	2005-04-20 21:13:19.000000000 +0200
+++ autorange.c
@@ -45,10 +45,9 @@ int mininit, maxinit;
 
 /* see what scaletype is being used.. */
 Egetunits( axis, unittyp );
-/* for linear, default to automatic determination of reasonable endpoints.. */
 if( strcmp( unittyp, "linear" )==0 ) strcpy( nearest, "auto" );
-/* for date, time, and other types, default to exact endpoints.. */
-else strcpy( nearest, "exact" );
+else if ( GL_smemberi( unittyp, "date time datetime" )) strcpy( nearest, "datematic" );
+else strcpy( nearest, "exact" ); /* categories? */
 
 margin = 0.0;
 strcpy( dfield, "" );
@@ -110,7 +109,7 @@ if( ndf == 0 ) return( Eerr( 7194, "auto
 /* ----------------- */
 
 /* override.. */
-if( stricmp( nearest, "day" )==0 && stricmp( unittyp, "date" )==0 ) strcpy( nearest, "exact" );
+/* if( stricmp( nearest, "day" )==0 && stricmp( unittyp, "date" )==0 ) strcpy( nearest, "exact" ); */ /* removed scg 4/19/05 */
 
 /* find data min and max.. */
 
@@ -190,8 +189,8 @@ max += margin;
 
 /* degenerate case.. all data the same (bad if it happens to lie on inc boundary, eg: 0) - added scg 9/21/01 */
 if( min == max ) {
-	min = min - 1.0;
-	max = max + 1.0;
+	/* min = min - 1.0; max = max + 1.0; */
+	min -= (min*0.2); max += (max*0.2);  /* changed to work better w/ small magnitude values - scg 3/3/05 */
 	}
 
 
@@ -208,7 +207,8 @@ else	{
 
 /******* handle nearest=  ***********/
 
-if( GL_slmember( nearest, "dat*matic" ) || ( stricmp( nearest, "exact" )==0 && GL_smember( unittyp, "datetime time" )) ) {
+if( GL_slmember( nearest, "dat*matic" ) ) {
+	/* || ( stricmp( nearest, "exact" )==0 && GL_smember( unittyp, "datetime time" )) ) { */ /* removed scg 4/19/05 */
 	char foo1[40], foo2[40], foo3[40], foo4[40], foo5[40], foo6[40];
 	double dfoo1, dfoo2;
 	/* get an automatic reasonable "nearest" value.. */