All pastes #634950 Raw Edit

Unnamed

public text v1 · immutable
#634950 ·published 2007-07-26 19:18 UTC
rendered paste body
private bool IsDraggableFrom( Vector2 position )
        {
            //  Check if there's another Window that has a higher draw order in front of this one.

            int windowIndex = Game.WindowManager.GetWindowIndex( this );
            int drawOrderIndex = Game.WindowManager.DrawOrder.IndexOf( windowIndex );

            for( int i = drawOrderIndex; i < Game.WindowManager.DrawOrder.Count; i++ )
            {
                int WindowsIndex = Game.WindowManager.DrawOrder[ i ];
                Window windowRef = Game.WindowManager.WindowPool[ WindowsIndex ];
                if( position.X > windowRef.Position.X &&
                    position.Y > windowRef.Position.Y &&
                    position.X < windowRef.Position.X + windowRef.Frame.Width &&
                    position.Y < windowRef.Position.Y + windowRef.Frame.Height )
                {
                    return false;
                }
            }

            return
                (
                position.X > Position.X &&
                position.Y > Position.Y &&
                position.X < Position.X + Frame.Width &&
                position.Y < Position.Y + CaptionDimensions.Height
                );
        }