Lines Matching refs:buf
62 sp_caxonomgrid_drawline (SPCanvasBuf *buf, gint x0, gint y0, gint x1, gint y1, guint32 rgba)
64 cairo_move_to(buf->ct, 0.5 + x0, 0.5 + y0);
65 cairo_line_to(buf->ct, 0.5 + x1, 0.5 + y1);
66 ink_cairo_set_source_rgba32(buf->ct, rgba);
67 cairo_stroke(buf->ct);
71 sp_grid_vline (SPCanvasBuf *buf, gint x, gint ys, gint ye, guint32 rgba)
73 if ((x < buf->rect.left()) || (x >= buf->rect.right()))
76 cairo_move_to(buf->ct, 0.5 + x, 0.5 + ys);
77 cairo_line_to(buf->ct, 0.5 + x, 0.5 + ye);
78 ink_cairo_set_source_rgba32(buf->ct, rgba);
79 cairo_stroke(buf->ct);
521 CanvasAxonomGrid::Render (SPCanvasBuf *buf)
533 cairo_save(buf->ct);
534 cairo_translate(buf->ct, -buf->rect.left(), -buf->rect.top());
535 cairo_set_line_width(buf->ct, 1.0);
536 cairo_set_line_cap(buf->ct, CAIRO_LINE_CAP_SQUARE);
539 // sc = screencoordinates ( for example "buf->rect.left()" is in screencoordinates )
545 buf_tl_gc[Geom::X] = buf->rect.left() - ow[Geom::X];
546 buf_tl_gc[Geom::Y] = buf->rect.top() - ow[Geom::Y];
547 buf_br_gc[Geom::X] = buf->rect.right() - ow[Geom::X];
548 buf_br_gc[Geom::Y] = buf->rect.bottom() - ow[Geom::Y];
554 gdouble const xstart_y_sc = ( xintercept_y_bc - floor(xintercept_y_bc/lyw)*lyw ) + buf->rect.top();
558 for (gdouble y = xstart_y_sc; y < buf->rect.bottom(); y += lyw, xlinenum++) {
559 gint const x0 = buf->rect.left();
561 gint x1 = x0 + round( (buf->rect.bottom() - y) / tan_angle[X] );
562 gint y1 = buf->rect.bottom();
564 x1 = buf->rect.right();
569 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
571 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
577 gdouble const xstart_x_sc = buf->rect.left() + (lxw_x - (xstart_y_sc - buf->rect.top()) / tan_angle[X]) ;
579 for (gdouble x = xstart_x_sc; x < buf->rect.right(); x += lxw_x, xlinenum--) {
580 gint const y0 = buf->rect.top();
581 gint const y1 = buf->rect.bottom();
586 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
588 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
597 for (gdouble x = ystart_x_sc; x < buf->rect.right(); x += spacing_ylines, ylinenum++) {
601 sp_grid_vline (buf, x0, buf->rect.top(), buf->rect.bottom() - 1, color);
603 sp_grid_vline (buf, x0, buf->rect.top(), buf->rect.bottom() - 1, _empcolor);
609 gdouble const zstart_y_sc = ( zintercept_y_bc - floor(zintercept_y_bc/lyw)*lyw ) + buf->rect.top();
614 for (gdouble y = zstart_y_sc; y < buf->rect.bottom(); y += lyw, zlinenum++, next_y = y) {
615 gint const x0 = buf->rect.left();
617 gint x1 = x0 + round( (y - buf->rect.top() ) / tan_angle[Z] );
618 gint y1 = buf->rect.top();
620 x1 = buf->rect.right();
625 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
627 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
633 gdouble const zstart_x_sc = buf->rect.left() + (next_y - buf->rect.bottom()) / tan_angle[Z] ;
634 for (gdouble x = zstart_x_sc; x < buf->rect.right(); x += lxw_z, zlinenum++) {
635 gint const y0 = buf->rect.bottom();
636 gint const y1 = buf->rect.top();
638 gint const x1 = x0 + round(buf->rect.height() / tan_angle[Z] );
641 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, color);
643 sp_caxonomgrid_drawline (buf, x0, y0, x1, y1, _empcolor);
648 cairo_restore(buf->ct);