Topic: Rotated text problems
I've just started using Diagram Designer, and it is working really well apart from one thing.
There are some problems with Rotated Text.
E.g
Create a rectangle width = 10mm, height = 40mm, rotate 90 degrees, and add the text 'Some text'
The text is unnecessarily split on to two lines.
Increasing the width of the text box to 20mm makes the text appear on a single line. So the width of the text box is being used to determine the line length for the text, whatever rotation is used.
Continuing from the previous example, set the vertical alignment to 'Top', and the text is now drawn outside the rectangle to the left side of the box. Similarly, the height of the box is being used to determine position of the text instead of the width.
Fixing this for arbitrary angles may be a bit tricky, but a workaround for multiples of 90 degrees would probably cover a high percentage of uses of text rotation for the minimum of effort. Alternatively, it may be better to have rotation apply to the whole object, and not just the text.
Here is something if put together in the expression evaluator to calculate the longest rotated line that fits in a rectangle.
:width = 10;
:height = 40;
:theta = pi / 2;
:len1 = abs( height / sin(theta) );
:len2 = abs( width / cos(theta) );
if(len1 < len2, len1, len2)
Chris Ward