Hello,
I'm using transparent ShapeNode's to display labels on my diagrams.
I need the node to be as big as the text with no padding from any of the sides.
I almost got it but I can't seem be able to remove the padding on left of the text.
This is what I do:
float x = 1;
float y = 1;
ShapeNode labelNode = diagram1.Factory.CreateShapeNode(x, y, 155, 6);
labelNode.TextFormat.FormatFlags = StringFormatFlags.NoWrap;
labelNode.Font = new Font("Arial", (float)0.5);
labelNode.Text = "Helllo wrolsdfasdfasdfad";
labelNode.Shape = Shapes.Rectangle;
labelNode.TextPadding = new Thickness((float)-0.071837675, (float)-0.051, (float)-0.100, (float)-0.051);
// tesrrr.Transparent = true;
labelNode.ResizeToFitText(FitSize.KeepHeight);
labelNode.ResizeToFitText(FitSize.KeepWidth);
labelNode.Move(1, 1);
This is what I get:
![35ksuuu.jpg 35ksuuu.jpg](http://i55.tinypic.com/35ksuuu.jpg)
Almost as big as the text but there is still padding on the left.
Any ideas?
Thanks in advance!
edit: Also noticed one other thing, the values im setting for TextPadding will not work (padding will be larger if text is longer) when the text inside the node changes.
So I guess I need a new way to do this, any tips are appreciated.