brain/viz.cc
/* Draw a rectangle on the surface at the given position */
Draw a rectangle on the surface at the given position
Draw a rectangle on the surface at the given position
static void
draw_brush_tiny_path(GtkWidget *widget,
           gdouble    x,
           gdouble    y, float strength)
{
    cairo_t *cr;
    cr = cairo_create(surface);
    cairo_rectangle(cr, x - 1, y - 1, 2, 2);
    cairo_set_source_rgb(cr, 0.05,0.6,abs(strength));
    cairo_fill(cr);
    cairo_destroy(cr);
    gtk_widget_queue_draw_area(widget, x - 1, y - 1, 2, 2);
}
static void draw_brush_tiny_path ( GtkWidget * widget , gdouble x , gdouble y , float strength ) { cairo_t * cr ; cr = cairo_create ( surface ) ; cairo_rectangle ( cr , x - 1 , y - 1 , 2 , 2 ) ; cairo_set_source_rgb ( cr , 0.05 , 0.6 , abs ( strength ) ) ; cairo_fill ( cr ) ; cairo_destroy ( cr ) ; gtk_widget_queue_draw_area ( widget , x - 1 , y - 1 , 2 , 2 ) ; }
Draw a rectangle on the surface at the given position
Draw a rectangle on the surface at the given position
//GdkRectangle rect; //gtk_widget_get_allocation(widget, &rect); //cout << "rect: " << rect.x << "," << rect.y << endl; /* Paint to the surface, where we store our state */ // double b = .1 * strength;  // if (b > 1) { // b = 1; // } // originally 0.15 /* Now invalidate the affected region of the drawing area. */