Inheritance: NClass.DiagramEditor.Diagrams.Shapes.Shape
Esempio n. 1
0
		internal override void Init(DiagramElement element)
		{
			shape = (CommentShape) element;
			
			txtComment.BackColor = Style.CurrentStyle.CommentBackColor;
			txtComment.ForeColor = Style.CurrentStyle.CommentTextColor;
			txtComment.Text = shape.Comment.Text;

			Font font = Style.CurrentStyle.CommentFont;
			txtComment.Font = new Font(font.FontFamily,
				font.SizeInPoints * shape.Diagram.Zoom, font.Style);
		}
Esempio n. 2
0
		internal void Relocate(CommentShape shape)
		{
			IDiagram diagram = shape.Diagram;
			if (diagram != null)
			{
				Rectangle absolute = shape.GetTextRectangle();
				// The following lines are required because of a .NET bug:
				// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=380085
				if (!MonoHelper.IsRunningOnMono)
				{
					absolute.X -= 3;
					absolute.Width += 3;
				}
				
				this.SetBounds(
					(int) (absolute.X * diagram.Zoom) - diagram.Offset.X + ParentLocation.X,
					(int) (absolute.Y * diagram.Zoom) - diagram.Offset.Y + ParentLocation.Y,
					(int) (absolute.Width * diagram.Zoom),
					(int) (absolute.Height * diagram.Zoom));
			}
		}