コード例 #1
0
        void TextImplementor.GetRangeExtents(int start_offset, int end_offset, CoordType coord_type, out TextRectangle rect)
        {
            Atk.TextRectangle result = new Atk.TextRectangle();
            var point1 = editor.LocationToPoint(Document.OffsetToLocation(start_offset));
            var point2 = editor.LocationToPoint(Document.OffsetToLocation(end_offset));

            result.X      = System.Math.Min(point2.X, point1.Y);
            result.Y      = System.Math.Min(point2.Y, point1.Y);
            result.Width  = System.Math.Abs(point2.X - point1.X);
            result.Height = (int)(System.Math.Abs(point2.Y - point1.Y) + editor.LineHeight);
            rect          = result;
        }
コード例 #2
0
		void TextImplementor.GetRangeExtents (int start_offset, int end_offset, CoordType coord_type, out TextRectangle rect)
		{
			Atk.TextRectangle result = new Atk.TextRectangle ();
			var point1 = editor.LocationToPoint (Document.OffsetToLocation (start_offset));
			var point2 = editor.LocationToPoint (Document.OffsetToLocation (end_offset));

			result.X = System.Math.Min (point2.X, point1.Y);
			result.Y = System.Math.Min (point2.Y, point1.Y);
			result.Width = System.Math.Abs (point2.X - point1.X);
			result.Height = (int)(System.Math.Abs (point2.Y - point1.Y) + editor.LineHeight);
			rect = result;
		}