[cairo] Layered stroke / fill

Lockert Fredrick lockert.fredrick at gmail.com
Sun Aug 19 04:44:28 PDT 2012


Greetings,

I'm currently programming a very simple gtkmm/cairo application, where
the user can draw lines, circles, rectangles, etc, in real time.

There's one problem I've got though, and I can't quite figure out how
to fix it. When the user draws out rectangles, they "merge" into each
other, rather then being painted on top of each other. I'm sure this
is an easy fix, but I couldn't find an answer after searching the web
and the documentation (probably used the wrong keywords...)

Here's what I've currently got:
http://fureloka.com/files/dev/gtkmm/gtkmm_rectangle_drawing.png

Here's what I wish to achieve:
http://fureloka.com/files/dev/gtkmm/win32_api_rectangle_drawing.png

Source:
http://fureloka.com/files/dev/gtkmm/main.cpp
http://fureloka.com/files/dev/gtkmm/drawarea.h
http://fureloka.com/files/dev/gtkmm/drawarea.cpp

I would really really appreciate it, if someone could point me in the
right direction!

Cheers,
Fredrick


More information about the cairo mailing list