[Ipe-discuss] ipeqt::Canvas clipping

Otfried Cheong otfried at ipe.airpost.net
Fri Nov 5 06:20:50 CET 2010


On 11/05/2010 02:19 PM, Otfried Cheong wrote:
> ipeqt::Canvas does not provide an option to clip the objects to the
> paper. You could add that easily, though, by inserting something like
> this at the beginning of Canvas::drawObjects(cairo_t *cc) (I haven't
> checked it, but this should work):
>
> const Layout *l = iCascade->findLayout();
> cairo_rectangle(cc, -l->iOrigin.x, -l->iOrigin.y,
> l->iPaperSize.x, l->iPaperSize.y);
> cairo_clip(cc)
>
> I would be happy to add this to the Canvas class (with an option to turn
> it on or off, of course) if it fills a need and you are actually reusing
> ipeqt::Canvas in your code.

If you just use Canvas to visualize some Ipe objects that you create 
only for this purpose, you could of course also simply enclose all Ipe 
objects in a ipe::Group and set a clipping path on that group.

Otfried




More information about the Ipe-discuss mailing list