The R Project SVN R

Rev

Rev 11499 | Rev 13400 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11499 Rev 12841
Line 2923... Line 2923...
2923
 
2923
 
2924
 
2924
 
2925
void GMMathText(SEXP str, int side, double line, int outer,
2925
void GMMathText(SEXP str, int side, double line, int outer,
2926
		double at, int las, DevDesc *dd)
2926
		double at, int las, DevDesc *dd)
2927
{
2927
{
2928
    int coords = 0;
2928
    int coords, subcoords;
2929
    double a, xadj, yadj;
2929
    double angle, xadj, yadj;
2930
 
2930
 
2931
#ifdef BUG61
2931
#ifdef BUG61
2932
#else
2932
#else
2933
    /* IF font metric information is not available for device */
2933
    /* IF font metric information is not available for device */
2934
    /* then bail out */
2934
    /* then bail out */
Line 2938... Line 2938...
2938
	error("Metric information not yet available for this device");
2938
	error("Metric information not yet available for this device");
2939
#endif
2939
#endif
2940
 
2940
 
2941
    MathDevice = dd;
2941
    MathDevice = dd;
2942
 
2942
 
2943
    if (outer) {
-
 
2944
	xadj = MathDevice->gp.adj;
2943
    xadj = MathDevice->gp.adj;
-
 
2944
 
-
 
2945
    /* This is MOSTLY the same as the same section of GMtext
-
 
2946
     * BUT it differs because it sets different values for yadj for
-
 
2947
     * different situations.
2945
	yadj = NA_REAL;
2948
     * Paul
-
 
2949
     */
-
 
2950
    if(outer) {
2946
	switch (side) {
2951
	switch(side) {
2947
	case 1:	a = 0;  coords = OMA1; 	break;
2952
	case 1:	    coords = OMA1;	break;
2948
	case 2:	a = 90; coords = OMA2;	break;
2953
	case 2:	    coords = OMA2;	break;
2949
	case 3:	a = 0;  coords = OMA3;	break;
2954
	case 3:	    coords = OMA3;	break;
2950
	case 4:	a = 90;	coords = OMA4;	break;
2955
	case 4:	    coords = OMA4;	break;
2951
	default: return;/* never happens */
-
 
2952
	}
2956
	}
2953
	GMathText(at, line, coords, str, xadj, yadj, a, dd);
2957
	subcoords = NIC;
2954
    }
2958
    }
2955
    else {
2959
    else {
2956
	switch (side) {
2960
	switch(side) {
2957
	case 1:
2961
	case 1:	    coords = MAR1;	break;
2958
	    if (las == 2 || las == 3) {/* perpendicular */
2962
	case 2:	    coords = MAR2;	break;
2959
		at = at - GConvertXUnits(dd->gp.yLineBias,
2963
	case 3:	    coords = MAR3;	break;
-
 
2964
	case 4:	    coords = MAR4;	break;
-
 
2965
	}
2960
					 LINES, USER, dd);
2966
	subcoords = USER;
-
 
2967
    }
2961
		line = line + dd->gp.yLineBias;
2968
    /* Note: I changed dd->gp.yLineBias to 0.3 here. */
-
 
2969
    /* Purely visual tuning. RI */
-
 
2970
    switch(side) {
2962
		a = 90.0;
2971
    case 1:
-
 
2972
	if(las == 2 || las == 3) {
-
 
2973
	    at = at + GConvertXUnits(0.3, LINES, subcoords, dd);
2963
		xadj = 1.0;
2974
	    angle = 90;
2964
		yadj = 0.5;
2975
	    yadj = 0.5;
2965
	    }
2976
	}
2966
	    else {
2977
	else {
2967
		line = line + 1 - dd->gp.yLineBias;
2978
	    line = line + 1 - dd->gp.yLineBias;
2968
		a = 0.0;
2979
	    angle = 0;
2969
		xadj = MathDevice->gp.adj;
-
 
2970
		yadj = NA_REAL;
2980
	    yadj = NA_REAL;
2971
	    }
2981
	}
2972
	    coords = MAR1;
-
 
2973
	    break;
2982
	break;
2974
	case 2:
2983
    case 2:
2975
	    if (las == 1 || las == 2) {
2984
	if(las == 1 || las == 2) {
2976
		at = at + GConvertYUnits(dd->gp.yLineBias,
2985
	    at = at - GConvertYUnits(0.3, LINES, subcoords, dd);
2977
					 LINES, USER, dd);
-
 
2978
		line = line + dd->gp.yLineBias;
-
 
2979
		a = 0.0;
-
 
2980
		xadj = 1.0;
2986
	    angle = 0;
2981
		yadj = 0.5;
2987
	    yadj = 0.5;
2982
	    }
2988
	}
2983
	    else {
2989
	else {
2984
		line = line + dd->gp.yLineBias;
2990
	    line = line + dd->gp.yLineBias;
2985
		a = 90.0;
2991
	    angle = 90;
2986
		xadj = MathDevice->gp.adj;
-
 
2987
		yadj = NA_REAL;
2992
	    yadj = NA_REAL;
2988
	    }
2993
	}
2989
	    coords = MAR2;
-
 
2990
	    break;
2994
	break;
2991
	case 3:
2995
    case 3:
2992
	    if (las == 2 || las == 3) {/* perpendicular */
2996
	if(las == 2 || las == 3) {
2993
		at = at - GConvertXUnits(dd->gp.yLineBias,
2997
	    at = at + GConvertXUnits(0.3, LINES, subcoords, dd);
2994
					 LINES, USER, dd);
-
 
2995
		line = line + dd->gp.yLineBias;
-
 
2996
		a = 90.0;
-
 
2997
		xadj = 0.0;
2998
	    angle = 90;
2998
		yadj = 0.5;
2999
	    yadj = 0.5;
2999
	    }
3000
	}
3000
	    else {
3001
	else {
3001
		line = line + dd->gp.yLineBias;
3002
	    line = line + dd->gp.yLineBias;
3002
		a = 0.0;
3003
	    angle = 0;
3003
		xadj = MathDevice->gp.adj;
-
 
3004
		yadj = NA_REAL;
3004
	    yadj = NA_REAL;
3005
	    }
3005
	}
3006
	    coords = MAR3;
-
 
3007
	    break;
3006
	break;
3008
	case 4:
3007
    case 4:
3009
	    if (las == 1 || las == 2) {
3008
	if(las == 1 || las == 2) {
3010
		at = at + GConvertYUnits(dd->gp.yLineBias,
3009
	    at = at - GConvertYUnits(0.3, LINES, subcoords, dd);
3011
					 LINES, USER, dd);
-
 
3012
		line = line + dd->gp.yLineBias;
-
 
3013
		a = 0.0;
-
 
3014
		xadj = 0.0;
3010
	    angle = 0;
3015
		yadj = 0.5;
3011
	    yadj = 0.5;
3016
	    }
3012
	}
3017
	    else {
3013
	else {
3018
		line = line + 1 - dd->gp.yLineBias;
3014
	    line = line + 1 - dd->gp.yLineBias;
3019
		a = 90.0;
3015
	    angle = 90;
3020
		xadj = MathDevice->gp.adj;
-
 
3021
		yadj = NA_REAL;
3016
	    yadj = NA_REAL;
3022
	    }
-
 
3023
	    coords = MAR4;
-
 
3024
	    break;
-
 
3025
	default: return;/* never happens */
-
 
3026
	}
3017
	}
3027
	GMathText(at, line, coords, str, xadj, yadj, a, dd);
3018
	break;
3028
    }
3019
    }
-
 
3020
    GMathText(at, line, coords, str, xadj, yadj, angle, dd);
3029
}/* GMMathText */
3021
}/* GMMathText */