Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_canvas_mark_rect ( SPCanvas canvas,
int  nl,
int  nt,
int  nr,
int  nb,
uint8_t  val 
) [static]

Helper that marks specific canvas rectangle as clean (val == 0) or dirty (otherwise)

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

References SPCanvas::tBottom, SPCanvas::tileH, SPCanvas::tiles, SPCanvas::tLeft, SPCanvas::tRight, and SPCanvas::tTop.

Referenced by sp_canvas_paint_single_buffer().

{
    if ( nl >= nr || nt >= nb ) {
        return;
    }
    int tl=sp_canvas_tile_floor(nl);
    int tt=sp_canvas_tile_floor(nt);
    int tr=sp_canvas_tile_ceil(nr);
    int tb=sp_canvas_tile_ceil(nb);
    if ( tl >= canvas->tRight || tr <= canvas->tLeft || tt >= canvas->tBottom || tb <= canvas->tTop ) return;
    if ( tl < canvas->tLeft ) tl=canvas->tLeft;
    if ( tr > canvas->tRight ) tr=canvas->tRight;
    if ( tt < canvas->tTop ) tt=canvas->tTop;
    if ( tb > canvas->tBottom ) tb=canvas->tBottom;

    for (int i=tl; i<tr; i++) {
        for (int j=tt; j<tb; j++) {
            canvas->tiles[(i-canvas->tLeft)+(j-canvas->tTop)*canvas->tileH] = val;
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index