Not really. Not with the model of draw and forget.
What are trying to do with InvertRect? There may be a different
approach to the problem you can use.
When elements are selected in Creator (our page layout app), they
have handles. We've always used InvertRect to draw these handles,
because that ensures they're always visible no matter what's being
the handle. Simply drawing a black square won't work because the
entire background could be black. Under certain conditions (a
contained element is selected), we also use a "hollow" handle, which
is a white background with a 1px black frame, so using that somewhat
common method already has a meaning in Creator.
There's also the problem that I haven't even looked at yet of
drawing an outline when new elements are in the process of being
created by dragging out their bounds with a tool. Also, when
resizing an existing element, we draw with a pattern for the outline
being rubber banded around. Both methods use xor drawing to draw the
new path and erase the old path. Live drawing of the actual shape
*could* be used instead, but it could be very slow if the shape is
complex (100-point starburst with round valleys and peaks), and we'd
have to draw the entire spread for every mouse movement. That could
be painfully slow in this situation as there could be hundreds and
hundreds of text, graphic, or shape elements.
Have you considered using an overlay window for your handles and
outlines. That gives you a lot of flexibility as well as the
possibility of making your handles and outlines partially
transparent. I think this is how most native OS X apps handle these
things nowadays (but let anyone correct me if I am wrong). You group
the overlay window together with your normal window so that the
handles are not draw on top of someone else's window or so.
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden