ui/gtk/draw_cairo.c

changeset 114
909fe96e5659
parent 105
86d729874ff4
child 115
102fc0b8fe3e
equal deleted inserted replaced
113:500c085d2133 114:909fe96e5659
103 double dblue = (double)blue / (double)255; 103 double dblue = (double)blue / (double)255;
104 cairo_set_source_rgb(gr->cr, dred, dgreen, dblue); 104 cairo_set_source_rgb(gr->cr, dred, dgreen, dblue);
105 } 105 }
106 106
107 107
108 void ui_draw_line(UiGraphics *g, int x1, int y1, int x2, int y2) {
109 UiCairoGraphics *gr = (UiCairoGraphics*)g;
110 cairo_set_line_width(gr->cr, 1);
111 cairo_move_to(gr->cr, x1, y1);
112 cairo_line_to(gr->cr, x2, y2);
113 cairo_stroke(gr->cr);
114 }
115
108 void ui_draw_rect(UiGraphics *g, int x, int y, int w, int h, int fill) { 116 void ui_draw_rect(UiGraphics *g, int x, int y, int w, int h, int fill) {
109 UiCairoGraphics *gr = (UiCairoGraphics*)g; 117 UiCairoGraphics *gr = (UiCairoGraphics*)g;
110 cairo_set_line_width(gr->cr, 1); 118 cairo_set_line_width(gr->cr, 1);
111 cairo_rectangle(gr->cr, x, y, w, h); 119 cairo_rectangle(gr->cr, x, y, w, h);
112 if(fill) { 120 if(fill) {

mercurial