System.Windows.Forms.XplatUIX11.DrawReversibleRectangle C# (CSharp) Method

DrawReversibleRectangle() private method

private DrawReversibleRectangle ( IntPtr handle, Rectangle rect, int line_width ) : void
handle System.IntPtr
rect System.Drawing.Rectangle
line_width int
return void
		internal override void DrawReversibleRectangle(IntPtr handle, Rectangle rect, int line_width)
		{
			IntPtr		gc;
			Control control = Control.FromHandle(handle);

			gc = GetReversibleControlGC (control, line_width);

			if ((rect.Width > 0) && (rect.Height > 0)) {
				XDrawRectangle(DisplayHandle, control.Handle, gc, rect.Left, rect.Top, rect.Width, rect.Height);
			} else {
				if (rect.Width > 0) {
					XDrawLine(DisplayHandle, control.Handle, gc, rect.X, rect.Y, rect.Right, rect.Y);
				} else {
					XDrawLine(DisplayHandle, control.Handle, gc, rect.X, rect.Y, rect.X, rect.Bottom);
				}
			}
			XFreeGC(DisplayHandle, gc);
		}
XplatUIX11