Dear list,<br><br>lets assume, that I have two overlapping rectangles.
A big one (0, 0, 100, 100 defined as bigBoxPath) and a small one ( 40,
60, 60, 120 defined as smallBoxPath) that has some part of it outside
the bigger rectangle. The outer rect for that whould be something like
(0, 0, 100, 120, defined as outerBoxPath) without taking in account,
that a stroke would make that bounding rect bigger because of how the
stroke works.<br>
<br>I can create a path and fill them both, but now I want to stroke
around the outline of the complete shape, but no 'stroke' should appear
inside the shape. Also it would be nice, if this stroke can happen with
a dashed line...<br>
<br>Any hints how to do that or where to look to find out? This also
should work with any shape for the two paths: rectangles are just the
simplest ones...<br><br>The ultimate goal is actually to draw a speech
bubble with multiple tipping points, while the speech bubble might be
an ellipse shape or even some random shape...<br>
I am not trying to do that with one path, because at some point the
tipping point needs to be moved, and then the construction of the path
would get crazy, so my goal at the moment is to draw the 'textbox' and
the tipping points as separate objects...<br>
<br>Thank you so much in advance,<br>Stefan<br><br>PS-1:<br>Yes, I
searched the archive and saw the posts about interactive drawing (which
I am doing) and the union of paths, but they did not really help...<br><br>PS-2:<br>
I experimented with some clipping like in the following code fragment,
that is using my own library that is wrapping the Cairo commands, but
it should be obvious what it does.<br>It
does almost what I want but the outline of the smaller box is not
drawn, because the clipping of the bigger box is using the fill shape,
so the intersections are ugly...<br>
<br> context->Save();<br><br> context->SetColor(0, 0, 255, 128);<br> context->Path(bigBoxPath);<br> context->Path(smallBoxPath);<br> context->Fill();<br><br> context->SetFillRule(CAIRO_<div>
FILL_RULE_EVEN_ODD);<br>
context->Path(smallBoxPath);<br> context->Path(outerBoxPath);<br> context->Clip();<br> context->SetFillRule( CAIRO_FILL_RULE_WINDING);<br><br> context->SetColor(128, 0, 0, 255);<br> context->SetLineWidth(frameWidth);<br>
context->Path(bigBoxPath);<br> context->Stroke();<br> context->ResetClip();<br><br> context->SetFillRule( CAIRO_FILL_RULE_EVEN_ODD);<br> context->Path(outerBoxPath);<br> context->Path(bigBoxPath);<br>
context->Clip();<br> context->SetFillRule( CAIRO_FILL_RULE_WINDING);<br><br> context->SetColor(128, 0, 0, 255);<br> context->SetLineWidth(frameWidth);<br> context->Path(smallBoxPath);<br> context->Stroke();<br>
context->ResetClip();<br><br> context->Restore();</div>