Ejemplo n.º 1
0
void draw_canvas(struct ScreenContext *screenContext) 
{

	/* draw background */
	cairo_set_source_rgb(screenContext->cr_on_canvas, 1, 1, 1);
	cairo_paint(screenContext->cr_on_canvas);	
	cairo_rectangle(screenContext->cr_on_canvas, MARGIN, MARGIN,screenContext->scr_width-2*MARGIN, screenContext->scr_height-2*MARGIN);
	cairo_clip(screenContext->cr_on_canvas);
	cairo_rectangle(screenContext->cr_on_canvas, MARGIN, MARGIN,screenContext->scr_width-2*MARGIN, screenContext->scr_height-2*MARGIN);
	cairo_set_source_rgb(screenContext->cr_on_canvas, 176.0/255, 212.0/255, 236.0/255);
	cairo_fill(screenContext->cr_on_canvas);


	/* draw districts */
	draw_districts(screenContext);

	/* draw rivers */
	draw_rivers(screenContext);

	/* draw roads */
	draw_roads(screenContext);

	/* draw crosses */
	draw_crosses(screenContext);

	draw_dynamic_on_screen(screenContext);
}
Ejemplo n.º 2
0
void
draw_grid(cairo_t *cr, gint width, gint height)
{
  if (grid_snap && grid_type != GRID_HIDDEN)
    {
      cairo_save (cr);
      if (grid_type == GRID_LINES)
        {
          draw_lines(cr, width, height);
        }
      else
        {
          draw_crosses(cr, width, height);
        }
      cairo_restore (cr);
    }
}