added pan operation and limit to a rect width*2 x height