GoLabeledLink's Line draws through text

I'm using a GoLabeledLink. I'm setting the MidLabel to a RotatedText object and setting MidLabelCentered to true. <?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

RotatedText midText = new RotatedText();

MidLabelCentered = true;

MidLabel = midText;

The text is correctly drawn on the GoLink and centered correctly (middle of the link). However, the stroke is drawn through the text. I'd like to center the text on the line, but not draw the line through the text. I addition I want to keep the GoText's background transparent. [I think this is the have my cake and eat it too scenario] :)

The only way I can think of to do this is to derive from GoStroke and add a Region property that I XOR with the Region of the rotated text in the paint method. Can you think of a better way to accomplish this?

Before we answer about trying to change the painting of the stroke to have a break in the middle, could you change the GoText’s background to be the same as the background of the view (or document’s paper color)?

I could change the GoText background to be the same as the view. However, in our application, the user can change the color of the background.

In Addition other GoObjects (GoShapes) can be placed behind the link (and GoText) as well, so there is no guarantee that the background color is the correct color for the GoText's background.

GoStroke.Paint is a pretty non-trivial piece of code, especially if you are using arrowheads or highlighting. I think Walter’s suggestion of setting the bg color, and setting all the label backgrounds when the paper color changes is the best solution.

I don’t see how xor would help you here.

Thanks both of you!

I may stick with the simpler solution you suggest of keeping the RotatedText's background on my GoLabeledLink in Sync with the Documents PaperColor.
I'll expose the background property of the Gotext on the link to the users of our application. If they find themselves in a situation where this doesn't work, they can correct it.
~Ken