64 lab = g_strdup_printf (
"%.10lf",
val);
65 for (i=0; i < strlen(
lab); i++)
67 tmp = g_strdup_printf (
"%c",
lab[i]);
68 if (g_strcmp0 ((
char *)tmp,
".") == 0) j = i;
71 for (i=0; i < j + this_proj -> curves[
activer][
activec] -> labels_digit[axe] + 1; i++)
75 label = g_strdup_printf (
"%c",
lab[i]);
79 tmp = g_strdup_printf (
"%s%c",
label,
lab[i]);
81 label = g_strdup_printf (
"%s", tmp);
88 pango_layout_get_size (
layout, & i, & j);
91 u = sin (this_proj -> curves[
activer][
activec] -> labels_angle[axe]) * (double)i;
92 v = sin (
pi / 2.0 - this_proj -> curves[
activer][
activec] -> labels_angle[axe]) * (double)j;
93 ay =
ay - (u + v)/PANGO_SCALE;
97 u = sqrt (1.0*i*i + 1.0*j*j);
98 v = atan ((1.0*j) / (1.0*i));
99 u = u * cos (this_proj -> curves[
activer][
activec] -> labels_angle[axe] + v);
100 ax =
ax - u / PANGO_SCALE;
103 cairo_move_to (cr,
ax,
ay);
104 cairo_rotate (cr, this_proj -> curves[
activer][
activec] -> labels_angle[axe]);
105 pango_cairo_update_layout (cr,
layout);
106 pango_cairo_show_layout (cr,
layout);
108 cairo_rotate (cr, -this_proj -> curves[
activer][
activec] -> labels_angle[axe]);
109 pango_cairo_update_layout (cr,
layout);
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label