Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Text vertical alignment in a ShapeNode (Read 2256 times)
Francesco
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Apr 10th, 2017
Text vertical alignment in a ShapeNode
Aug 10th, 2017 at 10:01am
Print Post  
I would like to insert some text at the bottom of a ShapeNode.
I use: this.TextVerticalAlignment = System.Windows.Media.AlignmentY.Bottom;
but the text appears in the center of the node, not in the bottom. (TextAlignment, on the other hand, works fine for horizontal alignment)
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3447
Joined: Oct 19th, 2005
Re: Text vertical alignment in a ShapeNode
Reply #1 - Aug 11th, 2017 at 10:35am
Print Post  
Code
Select All
var n1 = diagram.Factory.CreateShapeNode(
	10, 10, 100, 100, Shapes.Rectangle);
n1.TextVerticalAlignment = AlignmentY.Bottom;
n1.Text = "bottom aligned";

var n2 = diagram.Factory.CreateShapeNode(
	140, 10, 100, 100, Shapes.Rectangle);
n2.TextVerticalAlignment = AlignmentY.Bottom;
n2.EnableStyledText = true;
n2.Text = "bottom aligned"; 



shows it bottom-aligned in my test. Please check if some later code isn't resetting the alignment, or let me know what property values reproduce that.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Francesco
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Apr 10th, 2017
Re: Text vertical alignment in a ShapeNode
Reply #2 - Aug 11th, 2017 at 11:44am
Print Post  
Thank you, Slavcho!
It was an error of mine. I had tested it only on nodes taken from a saved tree. If I create new nodes, vertical alignment is correct. It was overwritten somewhere...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint