BitmapSaverWindow.DrawDragLine C# (CSharp) Method

DrawDragLine() private method

private DrawDragLine ( Rect pos ) : void
pos Rect
return void
    private void DrawDragLine( Rect pos )
    {
        Event e = Event.current;
        int   w = 10;
        Rect  d = new Rect( sideWidth, pos.y, w, pos.height+25 );

        GUIDraw.DrawRect( d, new Color( 0,0,0,0) );

        if( d.Contains( e.mousePosition ))
        {
            EditorGUIUtility.AddCursorRect (d, MouseCursor.ResizeHorizontal );
            lineDrag = (  e.type == EventType.mouseDrag  ) ? true : false;
        }
        if(lineDrag && e.type == EventType.MouseUp || e.mousePosition.x<50 || e.mousePosition.x >EditorRect.width-50){
            lineDrag = false;
        }
        if( lineDrag )
        {
            sideWidth = e.mousePosition.x - w/2;
            Repaint();
        }
    }