implementation of clipping selection box