I have a simple, horizontal <Line>
element. This line has a RotateTransform applied to it, which slants the line at whatever angle I choose. The problem is that the rendered length of the line is calculated before the transformation is applied. The result is that the line no longer fits its parent element after it is rotated.
My current code looks similar to this, using 15° as an example:
<Grid Background="Orange">
<Line HorizontalAlignment="Left" VerticalAlignment="Bottom"
RenderTransformOrigin="0,0" Stretch="UniformToFill"
StrokeThickness="1" Stroke="Green" X1="0" Y1="0" X2="1" Y2="0">
<UIElement.RenderTransform>
<RotateTransform Angle="-15" />
</UIElement.RenderTransform>
</Line>
</Grid>
The result is this:
http://img179.imageshack.us/img179/2592/slantpartial.png
As shown, the line does not make contact with the right-side of the control, due to the rotation. I need the line to stretch to the largest size possible and fill its parent control completely, regardless of what I set the angle to. The angle will change dynamically at run-time, and I can't use slope calculation in my current project. I need to keep the RotateTransform as the means of slanting the line.
An example of what I need to accomplish - again, using 15° as an example:
http://img42.imageshack.us/img42/8276/slantcomplete.png