- step = _step_for_range (acre->x_axis.max -acre->x_axis.min);
- x = (floor (acre->x_axis.min / step) + 1) * step;
- while (x <= acre->x_axis.max) {
- cairo_move_to (cr, x, acre->y_axis.min);
- cairo_save (cr);
- {
- /* tick */
- cairo_save (cr);
- {
- cairo_identity_matrix (cr);
- cairo_rel_line_to (cr, 0, 0.5);
- cairo_rel_line_to (cr, 0, -ACRE_TICK_SIZE-0.5);
- cairo_set_line_width (cr, 1.0);
- cairo_stroke (cr);
- }
- cairo_restore (cr);
-
- /* label */
- cairo_save (cr);
- {
- PangoLayout *layout;
- int width, height;
- layout = _create_layout_printf (acre, "%g", x);
- cairo_move_to (cr, x, acre->y_axis.min);
- cairo_identity_matrix (cr);
- pango_layout_get_pixel_size (layout, &width, &height);
- cairo_rel_move_to (cr, -width / 2, ACRE_X_TICK_VALUE_PAD);
- _show_layout (cr, layout);
- }
- cairo_restore (cr);
+ /* tick */
+ cairo_save (cr);
+ {
+ if (ticks == ACRE_TICKS_X)
+ cairo_move_to (cr, t, acre->y_axis.min);
+ else
+ cairo_move_to (cr, acre->x_axis.min, t);
+
+ cairo_identity_matrix (cr);
+
+ if (ticks == ACRE_TICKS_X) {
+ cairo_rel_line_to (cr, 0, 0.5);
+ cairo_rel_line_to (cr, 0, -tick_size - 0.5);
+ } else {
+ cairo_rel_line_to (cr, -0.5, 0);
+ cairo_rel_line_to (cr, tick_size + 0.5, 0);