Example #1
0
KDE_NO_EXPORT void Surface::repaint (const SRect &rect) {
    Matrix matrix;
    IRect clip;
    clipToScreen (this, matrix, clip);
    IRect scr = matrix.toScreen (rect);
    clip = clip.intersect (scr);
    if (!clip.isEmpty ())
        view_widget->scheduleRepaint (clip);
}
Example #2
0
static void clipToScreen (Surface *s, Matrix &m, IRect &clip) {
    Surface *ps = s->parentNode ();
    if (!ps) {
        clip = IRect (s->bounds.x (), s->bounds.y (),
                s->bounds.width (), s->bounds.height ());
        m = Matrix (s->bounds.x (), s->bounds.y (), s->xscale, s->yscale);
    } else {
        clipToScreen (ps, m, clip);
        IRect scr = m.toScreen (s->bounds);
        clip = clip.intersect (scr);
        Matrix m1 = m;
        m = Matrix (s->bounds.x (), s->bounds.y (), s->xscale, s->yscale);
        m.transform (m1);
        if (!s->virtual_size.isEmpty ())
            m.translate (-s->x_scroll, -s->y_scroll);
    }
}