Logo Search packages:      
Sourcecode: inkscape version File versions

static void sp_canvas_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation 
) [static]

The canvas widget's size_allocate callback.

Definition at line 1208 of file sp-canvas.cpp.

References sp_canvas_request_redraw(), sp_canvas_resize_tiles(), SPCanvas::x0, and SPCanvas::y0.

Referenced by sp_canvas_class_init().

{
    SPCanvas *canvas = SP_CANVAS (widget);

    /* Schedule redraw of new region */
    sp_canvas_resize_tiles(canvas,canvas->x0,canvas->y0,canvas->x0+allocation->width,canvas->y0+allocation->height);
    if (allocation->width > widget->allocation.width) {
        sp_canvas_request_redraw (canvas,
                                  canvas->x0 + widget->allocation.width,
                                  0,
                                  canvas->x0 + allocation->width,
                                  canvas->y0 + allocation->height);
    }
    if (allocation->height > widget->allocation.height) {
        sp_canvas_request_redraw (canvas,
                                  0,
                                  canvas->y0 + widget->allocation.height,
                                  canvas->x0 + allocation->width,
                                  canvas->y0 + allocation->height);
    }

    widget->allocation = *allocation;

    if (GTK_WIDGET_REALIZED (widget)) {
        gdk_window_move_resize (widget->window,
                                widget->allocation.x, widget->allocation.y,
                                widget->allocation.width, widget->allocation.height);
    }
}


Generated by  Doxygen 1.6.0   Back to index