Esempio n. 1
0
        internal void Init(CommentShape element)
        {
            shape = element;
            txtComment.BackColor = shape.GetBackColor(Style.CurrentStyle);
            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)
		{
			Diagram 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));
			}
		}