The R Project SVN R

Rev

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

Rev 20197 Rev 20257
Line 2903... Line 2903...
2903
    MathPs = ps;
2903
    MathPs = ps;
2904
    CurrentStyle = STYLE_D;
2904
    CurrentStyle = STYLE_D;
2905
    SetFont(PlainFont);
2905
    SetFont(PlainFont);
2906
    bbox = RenderElement(expr, 0);
2906
    bbox = RenderElement(expr, 0);
2907
    width  = bboxWidth(bbox);
2907
    width  = bboxWidth(bbox);
-
 
2908
    /* 
-
 
2909
     * NOTE that we do fabs() here in case the device
-
 
2910
     * runs right-to-left.
-
 
2911
     * This is so that these calculations match those
-
 
2912
     * for string widths and heights, where the width
-
 
2913
     * and height of text is positive no matter how
-
 
2914
     * the device drawing is oriented.
-
 
2915
     */
2908
    return toDeviceWidth(width, GE_INCHES, dd);
2916
    return fabs(toDeviceWidth(width, GE_INCHES, dd));
2909
}
2917
}
2910
 
2918
 
2911
double GEExpressionHeight(SEXP expr, 
2919
double GEExpressionHeight(SEXP expr, 
2912
			  int font, double cex, double ps,
2920
			  int font, double cex, double ps,
2913
			  GEDevDesc *dd)
2921
			  GEDevDesc *dd)
Line 2921... Line 2929...
2921
    MathPs = ps;
2929
    MathPs = ps;
2922
    CurrentStyle = STYLE_D;
2930
    CurrentStyle = STYLE_D;
2923
    SetFont(PlainFont);
2931
    SetFont(PlainFont);
2924
    bbox = RenderElement(expr, 0);
2932
    bbox = RenderElement(expr, 0);
2925
    height = bboxHeight(bbox) + bboxDepth(bbox);
2933
    height = bboxHeight(bbox) + bboxDepth(bbox);
-
 
2934
    /* NOTE that we do fabs() here in case the device
-
 
2935
     * draws top-to-bottom (like an X11 window).
-
 
2936
     * This is so that these calculations match those
-
 
2937
     * for string widths and heights, where the width
-
 
2938
     * and height of text is positive no matter how
-
 
2939
     * the device drawing is oriented.
-
 
2940
     */
2926
    return toDeviceHeight(height, GE_INCHES, dd);
2941
    return fabs(toDeviceHeight(height, GE_INCHES, dd));
2927
}
2942
}
2928
 
2943
 
2929
void GEMathText(double x, double y, SEXP expr,
2944
void GEMathText(double x, double y, SEXP expr,
2930
		double xc, double yc, double rot, 
2945
		double xc, double yc, double rot, 
2931
		int col, double gamma, int font, double cex, double ps,
2946
		int col, double gamma, int font, double cex, double ps,