GetTextRectangle() private method

private GetTextRectangle ( ) : Rectangle
return System.Drawing.Rectangle
Esempio n. 1
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));
			}
		}