Hi,
I am successfully using ResizeToFitText, but I'd like some padding at either the right or left side of the text.
I've tried placing the TextPadding before and after the ResizeToFitText without luck.
Any ideas on how I can get the padding I'm looking for.
See attached screenshot.
I've also included the code that generates the nodes.
The diagram has a centered TreeLayout applied to it.
Thanks in advance
Jim
protected ShapeNode createNode(Diagram diagram, String nodeText, Boolean expandable, StringAlignment textAlign)
{
Factory factory = diagram.Factory;
ShapeNode node = factory.CreateShapeNode(0, 0, 100, 10, Shapes.RoundRect);
node.Text = nodeText;
node.Font = new Font("Arial", 12, System.Drawing.FontStyle.Bold);
node.TextFormat.Alignment = textAlign; // Far = right; Near = left
node.TextFormat.LineAlignment = StringAlignment.Center;
node.TextFormat.FormatFlags = StringFormatFlags.NoWrap;
node.Pen.Color = Color.White;
node.ShadowOffsetX = 0;
node.ShadowOffsetY = 0;
node.Brush = new MindFusion.Drawing.SolidBrush(Color.WhiteSmoke);
node.Expandable = expandable;
node.TextPadding = new MindFusion.Diagramming.Thickness(10f, 1f, 10f, 1f);
//node.ResizeToFitText(FitSize.KeepWidth);
node.ResizeToFitText(FitSize.KeepHeight);
return node;
}