[cairo] Clipping and on-demand redraw

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Sat Jan 9 20:30:34 PST 2016


On Sun, 10 Jan 2016 05:07:09 +0100, Enrico Weigelt, metux IT consult
wrote:

> On 09.01.2016 23:37, Lawrence D'Oliveiro wrote:
>> 
> > Or you could simplify it, and compute a bigger axis-aligned bounding
> > rectangle for a rotated widget. Then you only need to do operations
> > on axis-aligned rectangles.  
> 
> hmm, could you perhaps give me some example ?

In Python, using Qahirah:

    ldo at theon:hack> python3 -ic "import qahirah as qah"
    >>> p = qah.Rect(0, 0, 100, 100).to_path()
    >>> p.extents()
    Rect(0, 0, 100, 100)
    >>> p.transform(qah.Matrix.rotate(45 * qah.deg)).extents()
    Rect(-70.7109, 0, 141.422, 141.422)


More information about the cairo mailing list